setDataCleaningThreshold for Area Range Series

Viewed 64

I saw in version 3.00 there is something called setDataCleaningThreshold , Can you tell its benefits , I think it's for faster loading of progressive charts.

const dcThreshold = xVal - 100;
lineSeries.setDataCleaningThreshold(dcThreshold);
AreaRangeSeries.setDataCleaningThreshold(dcThreshold); // not working

But it's not working for Area range series.

Also there is setMaxPointCount in Area range Series , what is the difference between both ?

My charts are progressive and I want to clear the charts that are out of view and make the charts faster.What is the best way ? Can I use Dispose method ?

Also , can we drag the chart by left click + mouse drag. . I saw something like API for Axis mouse and touch events is released.Can you tell what can be achieved with this.

(right now its right click + drag).

1 Answers

it's not working for Area range series.

setDataCleaningThreshold is new API that will be slowly introduced to existing series. With v3.0 it is only introduced for LineSeries and its derivatives (like PointLineSeries).

To prevent confusion, please refer to official API documentation to see if some method is supported - for example if we look at AreaSeries, it is not part of the API.

Also there is setMaxPointCount in Area range Series , what is the difference between both ?

setMaxPointCount and setDataCleaningThreshold exist for the same purpose, and effectively achieve the same things, but they are based on slightly different ideas.

setMaxPointCount configures automatic data cleaning by specifying amount of data points to retain at the "head" of data.

setDataCleaningThreshold configures automatic data cleaning by specifying a coordinate on progressive axis. All data points that are "behind" this coordinate can be cleaned whenever convenient. This configuration is slightly preferred over "max points count" as it is more convenient for the rendering engine, and it also behaves slightly more logically - if you apply the fit() operation by dragging to top-left in chartXY with left mouse click, the axis will stop at data cleaning threshold, instead of showing all data including the data behind cleaning threshold.

Both of these methods will be supported for the time being and there should not be major differences between using either, so I recommend use whichever you feel more comfortable with.

Eventually the data cleaning configuration will settle down to a simpler API, but now we're still feeling how different users are using the library, and how we can optimize the performance best - so the API is a bit messy (as in, there are 2 methods for same purpose).

My charts are progressive and I want to clear the charts that are out of view and make the charts faster.What is the best way ?

For AreaSeries setMaxPointCount is the only automatic option. Please see the updated documentation on the method to learn more.

You can also implement manual data cleaning using dispose method, as you suggested. However, please see if automatic data cleaning works for you first.

Related