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://es.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
This has been reported as bug 26600 you can contact Developer Support if you would like status on this bug at any time.
As a work around, if you make sure there are some mock values in the chart when it first rendered, then the X axis will behave appropriately for the further updates.
Graham,
As usual thanks for your work and response..
Thank you very much!
I'm going to assume this is the same question as in this post: https://es.infragistics.com/community/forums/f/retired-products-and-controls/41956/xamwebchart-line-chart-tooltipdate-value-and-performance-issue
Please correct me if this is separate.
Hi Graham, We are adding dates as string like following, and we have 100 of values/datapoints but chart only show 4 or 5 values on x-axis.
Series srs = cht.Series[0];DataPoint dp;for (int i = 0; i < count; i++){ dp = new DataPoint(valDouble, valDate.ToString("MM/dd/yyyy")); srs.DataPoints.Add(dp); }
can you help me how to control number of labels on x-axis (We want more labels)? And can you tell me when will be this fix available, in 10.2 or else.
Thanks
This bug has been fixed, so should be resolved in the next service release.