Really appreciate if anyone could help me on the weird graph I've got. It just does not want to draw the line between two datapoints some times (not always, please see attached image). If I refresh the page to reload data several times, it works fine.
Your problem may be caused by passing unsorted data to the RadChart. While the chart does position each object according to the X axis, it doesn't connect it to its neighbor relative to the X axis, but rather to its corresponding neighbor from the underlying data source.
Consider this example:
this.RadChart1.DataContext = new List<KeyValuePair<DateTime, int>>()
{
new KeyValuePair<DateTime, int>(new DateTime(2012, 12, 3), 3),
new KeyValuePair<DateTime, int>(new DateTime(2012, 12, 4), 1),
new KeyValuePair<DateTime, int>(new DateTime(2012, 12, 5), 2),
new KeyValuePair<DateTime, int>(new DateTime(2012, 12, 6), 4)
};
In this case, the KeyValuePairs are sorted by Key (DateTime) in advance, so the chart will render as shown in the attached chart_sorted.jpg file.
On the other hand, should you populate the chart like this:
this.RadChart1.DataContext = new List<KeyValuePair<DateTime, int>>()
{
new KeyValuePair<DateTime, int>(new DateTime(2012, 12, 4), 1),
new KeyValuePair<DateTime, int>(new DateTime(2012, 12, 5), 2),
new KeyValuePair<DateTime, int>(new DateTime(2012, 12, 3), 3),
new KeyValuePair<DateTime, int>(new DateTime(2012, 12, 6), 4)
};
That is, should you populate the chart with unsorted data, it will render as shown in the attached chart_unsorted.jpg file.
Note that in both cases the data points are sorted relative to the X axis, but the order in which they are connected depends on the way they've been passed to the RadChart.