Forum > TAChart

Fastline series with simplification

<< < (2/4) > >>

hedgehog:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---    for i := 0 to Count-1 do      ListChartsource1.Add(i, sin(i/(Count-1)*2*pi)+(random(50)-100)/1000); In the screenshot you can see the difference.

wp:
I see. The speed comes with the noise, i.e. when there is a quick variation of the "angles" from point to point. But: the optimum epsilon depends on the chart size and the zoom level. Proof: Run the modified demo, increase the Epsilon so that the noise in the left chart disappears, then increase the size of the form and the size of the charts along with it --> the noise returns. Or draw a small zoom rectangle around some part of the smoothed curve --> the broad noise band is back.

hedgehog:

--- Quote ---But: the optimum epsilon depends on the chart size and the zoom level.

--- End quote ---
Of course!
There is no ideal epsilon value!
This is a significant part of computer science.
Every year many articles, dissertations and other scientific works on this topic are published. (I'm keeping track of this a bit).

wp:
But as a potential user of your series I'd be confused by a series looking differently when I change the size of the chart or when I zoom in. Why don't you do your calculation based on the graph coordinates (TDoublePoint) rather than on the image coordinates (TPoint)? Graph coordinates do not change when the chart size or zoom level changes.

hedgehog:

--- Quote ---I'd be confused by a series looking differently when I change the size of the chart or when I zoom in.

--- End quote ---
Yes, that's how it was intended.
Isnâ€™t it natural that when you zoom in, you see new small details?
And on the contrary, when you zoom out, some points disappear, but information about the main trends remains.
Have you ever used a regular magnifying glass? It works exactly the same.

--- Quote ---Why don't you do your calculation based on the graph coordinates (TDoublePoint) rather than on the image coordinates (TPoint)?

--- End quote ---

Yes, I understand what you're getting at.

There is one point here.

Simplification by TPoint (screen coordinates) is a universal function.
It does not matter how the set of points that need to be displayed is obtained (earthquake graph, cardiogram, Bitcoin rate, number of rabbits in Australia, etc.)

But, if we want to carry out a preliminary simplification of the original data set, then we must rely on the physical nature of this data set.
Optimal simplification of time series is different from simplification of GIS information.

And I think that preliminary simplification of the data set is not the task of the TChart component. This should be done by the developer based on the physical nature of his data set, and then sent to the TChart to show to the user.