Start plotting from the right side of the chart

Need help in implementing some specific function to your LightningChart Ultimate powered application? Post a question and get code snippets from other LightningChart Ultimate community members.

Moderator: Queue Moderators

Post Reply
larryp
Posts: 1
Joined: Fri Mar 14, 2014 9:09 pm

Start plotting from the right side of the chart

Post by larryp » Mon Mar 17, 2014 7:58 pm

I am evaluating the LightningChart control and have a sample project that plots real-time data on an XY chart using a SampleDataSeries. Everything works fine. However, all of the examples show data plotting on the left of the chart and when the chart is filled then it begins scrolling. I have a requirement that the data starts plotting on the right side of the chart, shifts the data left until the chart is filled, then begins scrolling. Any ideas?

Thanks,
Larry

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Start plotting from the right side of the chart

Post by ArctionPasi » Mon Mar 17, 2014 8:21 pm

Hi Larry,

There's two possibilities in principle:
1. Set XAxis.Reversed = true, and feed data to the end of PointLineSeries with AddSamples method, and set XAxis.ScrollPosition to the last sample's time stamp. The X axis labels run backwards. There's labels formatting FormatValueLabel event handler, and CustomTicks collection in X axis if you need to trick with the labels.

2. Use XAxis.Reversed = false, but use FreeformPointLineSeries instead. It allows feeding data also backwards. Use xAxis.SetRange to shift the data. This approach has a performance penalty compared to approach 1.
LightningChart Support Team, PT

Post Reply