So I have this fine legacy Delphi 5 project with a tchart with vertical bars along a datetime bottomaxis. It works very fine. Now I want to add up to three horizontal "warning"-lines, each with up to three togglable labels. The idea is to show three red limit lines(three 3-element lineseries), and labels at far left, middle and far right showing Yvalue limits. Labels are togglable in order not to clutter data. And it works too. These labels must sit at xmin, mid and xmax even when scrolling. I solved it with having a timer started when first dataseries is redrawn, and then resetting the three labelseries with the chart's new xmin, mid, xmax. When scrolling, the labels follow. But when I zoom in, something is lost. I print the xmin, xmax and line coordinates in the statusbar as it is recalculated (for debugging), it looks quite right, but the three horizontal lines slip away to the left. Leftmost point is out of sight, rightmost is drifting to the left, worse with increased zoom. Yvalues are correct.
Is there a best way to do plot-eventdriven recalculation of plotdata? (Or must I rebuild it all in my XE10.2? )
I just ran it at home, the same phenomenon appears in XE10.2. When I zoom in, the second series (horizontal line, endpoints recalculated to be at the graph's edges) creeps away to the side. However if I connect series2 to Topaxis, then everything is fine. Rock solid. Seems like a natural thing. Silly me.
Running,line stays put when scrolling