I am trying to render a line chart but the LineSeries is connecting the data points randomly each time I make it redraw the graph.
My items source is a typed List of my custom classes that have 2 properties, one for the x-axis and one for the y-axis (both are 'double' values). The values of these properties do not change and are loaded once.
My lines have several straight, vertical line jumps, i.e. the x-axis value is the same for 3 or 4 points, but the y-value changes. It properly connects these dots with a straight, vertical line.
But the odd thing is that it randomly uses any of the data points for the connection from the left and another one for the connection to the right.
I would assume that it uses the first point based on the order of the items source for the connection from the left and the last point for the connection to the right.
The items source is always in the same order, which is also the order in which I want them to be connected.
I tried attaching images, but am not allowed to ... So only a textual description is possible.
LineSeries ser = new LineSeries();
Chart.Series.Add(ser);
ser.DependentValuePath = "YAxis";
ser.IndependentValuePath = "XAxis"
ser.ItemsSource = data.Coordinates;
Does anybody know why this is happening? Thanks for any suggestions.
Its because the chart is Independent value based not Dependent value based. I had a similar issue with my "strip chart". It's as designed. Think of your chart as an x vs y plot flipped sideways. Now you can see how it plots. Changing the order of the points based on y doesn't do anything.
I don't think Telerik has this limitation.