With the following C code the contents of the X labels(String Date) are shown on a line chart using the following C:
Series ChartIIPulls = new Series { Label = "Pulls", ChartType = ChartType.Line, DataMapping = "Label=SDate;Value=Pulls;", DataSource = e.Result };The SDate is plotted correctly on the Chart.
==================================================================
When using the following XAML, the SDate is not plotted:
<igChart:XamWebChart.Series > <igChart:Series ChartType="Line" DataSource="{Binding}" DataMapping="Label=SDate;Value=Pulls;" Label="Pulls" > </igChart:Series>The C code used to connect the above code is the following:
PullsChart.DataContext = e.Result;
Using the above code the SDate is not plotted on the chart. Nothing shows for labels for the x axis.
Could you tell me what the difference is between the code how and show how to get the XAML code to start charting the X axis data items.
Thanks,
Keith
Keith,
I suspect this is a bug in the chart due to the data being loaded asynchronously, I'm going to investigate further and get back to you with a bug report number if this turns out to be the case, in the meantime, you can get around this by making sure DataContext has a collection with mock/sample data until the service returns, as it seems to be a problem with the category axis being bound to an empty collection, and then later a collection with values. See my last post in this thread for how I worked around the issue: https://ko.infragistics.com/community/forums/f/retired-products-and-controls/36805/how-to-connect-a-service-reference-in-xaml-instead-of-c-to-a-xamwebchart/213154#213154
You don't need to create a proxy object though, just make sure the datacontext has a non-empty list from the time the chart is constructed until you set the datacontext with the web service results.
-Graham