Real time line chart

I'm adding values to a line chart with a DateTime X-Axis in real time, at random intervals, and it works OK expect that the points are plotted at fixed intervals even though the actual time intervals vary.

Is there any way I can correct this?


3 Replies

PJ Pavithra J Syncfusion Team April 22, 2009 05:44 AM UTC

Hi Steve,

Thanks for your interest in Syncfusion products.

Since your expectation is to have equal DateTime interval on X-Axis, you can make use of the ChartAxis property "DateTimeInterval".

The below given code snippet will help you to maintain a constant interval of 1 mins.

[XAML]




[C#]

this.Chart1.Areas[0].PrimaryAxis.DateTimeInterval = new TimeSpan(0, 1, 0);

Please let us know if you have further queries.

Regards,
Pavithra.J




SL Steve Loft April 22, 2009 07:31 AM UTC

Thank you for the reply, but it doesn't seem to help. Perhaps I didn't explain it very well.

I've attached an image of a chart. The first two points are 5 seconds apart; the next are 3 seconds apart, the next 9 seconds, and so on. But on the chart, they are all the same distance apart. I need them to appear at the correct distance apart according to the time they were plotted.

Steve



chart_f5dfe984.zip


PJ Pavithra J Syncfusion Team April 23, 2009 07:38 AM UTC

Hi Steve,

Thanks for your interest in Syncfusion products.

For better look and feel we used to maintain equal distance between the datapoints. However it is possible plot datapoints based on positional values. For this IsIndexed property is helpful.

When IsIndexed property is set to false, all the values in the collection will be sorted in ascending order and they are plotted. Such an X axis that ignores the X-values and simply uses the positional value of a point in a series.

When IsIndexed is set to true, Y values will be plotted based on the order in which they are added to the collection and X values are displayed as labels in the X axis.

Please refer to the sample from the below given link, which clearly shows the behavior of Indexed mode.

IsIndexed Sample

But, you cannot visualizes the distance with continuous charts like line, as this will be drawn by joining all the points.

Please let us know if you have any queries.

Regards,
Pavithra.J


Loader.
Up arrow icon