Page 1 of 1

SampleDataSeries and Stair/Step shape

Posted: Tue Jul 05, 2016 8:24 am
by jorge
We need to render a graph with a stair/step shape, exactly the same as in the "Stair/Step" demo example. We started using a PointLineSeries, but for memory concerns we would like to switch to SampleDataSeries. Would it be possible to get the step shape with this kind of series? My understanding is that, as two points with the same X value are needed to get the step shape it wouldn't be possible because of the sampling interval, but maybe I am missing something.

Many thanks in advance.

Re: SampleDataSeries and Stair/Step shape

Posted: Tue Jul 05, 2016 10:34 am
by ArctionPasi
Hi,

SampleDataSeries is a fixed-interval series. X difference between data points is 1 / SamplingFrequency. So with this series type, it's unfortunately impossible to compose exactly vertical transition as it always has some slope in it because of progressing X.

In SampleDataSeries memory footprint is more compact regarding the points array, that's true. Points don't store X value, nor Tag field, and SampleDataSeries can also be used with 32-bit floating point accuracy, whereas PointLineSeries is 64-bit double only.

Currently PointLineSeries is the best way to achieve a stepping line.

Re: SampleDataSeries and Stair/Step shape

Posted: Tue Jul 05, 2016 12:25 pm
by jorge
Ok, thanks Pasi.

Re: SampleDataSeries and Stair/Step shape

Posted: Tue Oct 16, 2018 3:23 pm
by TheWiggin
I would like to second the request made by Jorge... Adding a Stair-step style to the PointLineSeries would be a real benefit to me.

My application works with a large volume of process data from industrial plants. Some of our users have accumulated mny years of data, such that a large data review plot might contain several million data points. With the graphics package we are currently using, it can take over a minute to render such a graph -- that is what led me to try out LightningChart. Using your package, drawing the plot takes less than a second. That's the difference between "it doesn't work" and "It works great!"

But in a plot with ~5 million data points, it is a major buden to allocate 10 million SeriesPoints... it literally halves the effective number of points we can show in a graph (i.e. before hitting the active memory limit & blowing up the performance).

I think this feature can be implemented with a very minor change. In the (inefficient) package I am currently using, I implemented a StepLine by subclassing their Series class to overide the OnDraw() behavior, and simply replaced the "LineTo(x,y)" with 2 calls, LineTo(x,y[i-1]); LineTo(x,y). Of course, I don't know what magic is required to achieve your high performance, so I might be way off. But please consider it... I imagine many of your customers could benefit from this.

Thanks,

Curt Carney (aka. TheWiggin)

Re: SampleDataSeries and Stair/Step shape

Posted: Wed Oct 17, 2018 8:55 am
by ArctionKestutis
see my answer here.