Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
442
How to connect a Service Reference in XAML instead of C# to a XamWebChart
posted

Hi,

  I can get XamWebChart to graph data using the following C# code:

            Series PullSeries = new Series
            {
                Label = "pulls",
                ChartType = ChartType.Line,
                DataMapping = "label=SDate;value=Pulls;",
                DataSource = e.Result
              }

                 PullsChart.Series.Add(PullandDeadsSeries);

e being = OnFeed_SL.ServiceReference1.GetPullsAndDeadsSTRDateCompletedEventArgs

To do the above what would be a code example in XAML...  What I am trying to do is the graph using BLEND to develop with and let BLEND connect up to the data source using XAML.

 

THANKS

Keith

 

Parents
  • 30692
    Suggested Answer
    Offline posted

    If that code behind is in your window or usercontrol class, set this.DataContext equal to the e.Result when the web service call returns, this has established the web service result as the data context for binding in the XAML for any children of the window/usercontrol.

    Then your series can look like this in XAML:

    <igChart:XamWebChart.Series>

                    <igChart:Series Label="pulls"

                                    ChartType="Line"

                                    DataSource="{Binding}"

                                    DataMapping="Label = SDate; Value = Pulls"/>

                </igChart:XamWebChart.Series>

     

    This help?

    -Graham

Reply Children