I have a webChart defined in my XAML file (View) with one series added. My ViewModel is retrieving data. ViewModel has a few properties that are binded to the series which are updated based on the type of data it retrieved. Everything works fine, if I have hard-coded data points on the series. So far I did not find a way to bind DataPoints correctly. My ViewModel has no knowledge of chart object and I'd like to keep it this way.
Along with this goes another question: how do I graph using Column series following points (X,Y):
(0, 15)(3, 20)(4, 35)(10, 10)(50, 28)?
So far my X values are treated as string data and plotted on the graph at values 1 through 5...
hi there,
good references for data binding are here:
http://help.infragistics.com/NetAdvantage/DV/2011.1/CLR4.0/?page=SL_DV_xamWebChart_Binding_xamWebChart_to_Data.html
http://help.infragistics.com/NetAdvantage/DV/2011.1/CLR4.0/?page=SL_DV_xamWebChart_Binding_xamWebChart_to_a_Collection_in_XAML.html
basically, you want to define a series, set the datasource and datamapping properties, and make sure your data collection implements inotifypropertychanged. feel free to post a code sample if you're running into issues.
as for column series: note that this is a category series, so it will always treat your x values as labels, not values on the x-axis. if you want the spacing on the x-axis to correlate to your data values, you could always define data points at every integer x value, and set the y-value for columns without data to zero.