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
Start plotting from the right side of the chart
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Start plotting from the right side of the chart
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.
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