This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello all! Is seems it should be possible to use a DataTable.DefaultView for the ItemsSource for a LineSeries. If so, how would I specify which columns to use for the xAxis and the yAxis? Thanks in advance! |
|
|
Hello This can be done by setting the XBinding and YBinding properties of the LineSeries. The data context of each data point will be a DataRowView object. This has a Row property which supports the index operator to get the value in a particular column. So the bindings will look like this:
Here column 0 is my X column, and column 1 is my Y column. Simply change these indices for you data. Jason Fauchelle |
|
|
If I specified the column index, would I get all the data in a specific column to bind to a particular axis? Could you please provide an example of this binding in C# instead of xaml as I am creating these series dynamically. |
|
|
Using the index operator in this way will get the one piece of data from the column specified by the index, and the row specified by the data point being rendered. This is done for each data point, so in the end, all X/Y data from the specified columns will be displayed on the chart. This is how you would set it up in code:
Jason Fauchelle |
|