Now I spent some time with this algorithm and was able to integrate it into TAChart's TFuncSeries. I am attaching a small demo testing a variety of topics (rotation of axes, axis transforms, domain exclusions), and it seems to me that everything is working correctly, but I would appreciate if you could test it before I commit it to the Lazarus repository.
Make a backup copy of your tafuncseries.pas and tacustomfuncseries.pas files (in folder components/tachart of your Lazarus installation) and replace these two files by those that you find in the attached zip. Rebuild the IDE.
The TFuncSeries has a few new properties now:
- StepMode = (smConstant, smAdaptive) -- constant is the previous (and still default) behaviour with constant steps, adaptive is the new behaviour. Having StepSize=smAdaptive replaces the curve drawing method ForEachPoint by a new method ForEachAdaptivePoint
- PixelOversampling -- determines how often a pixel is sampled at different locations. This is the constant 100 or 15 that you mentioned in reply #10.
- Epsilon -- determines the maximum pixel deviation in y direction at which a line segment is drawn.
The old property Step is reused as maximum step size after which a line segment is drawn for sure. Switching StepMode stores the current Step settings and restores those for the other mode.
There seems to be an issue in the combination of "xy rotated" and "y logarithmic", but the standard TFuncSeries has the same, therefore, I am ignoring this for the moment.