[Lazarus] TAChart marks on mouseoverpoint

Alexander Klenin klenin at gmail.com
Fri Sep 25 03:35:39 CEST 2009


2009/9/24 Andrea Mauri <andrea.mauri.75 at gmail.com>:
> I was misunderstood. With below I intend that marks are drawn back the
> points, and points over marks.
> I try again to attach two images, one from TAChart and one from Steema
> TChart. You can see that in TAChart points are visible and marks are drawn
> back points while in Steema TChart marks are always visible and they are
> drawn over points.

Ah, I see. I have to say that I deliberately choose to draw points over marks,
since I felt that points are more important.
I am not so sure now, but still would like more feedback from other users
on this issue before changing it.
Meanwhile, if you want to change it for your private build,
it is a simple matter of moving DrawLabels call to the end of
TLineSeries.Draw procedure.

> Maybe could be an option to have marks in front or back points?
Option is always a possibility, but too much options are bad too.

Generally, I think the solution to reduce labels overlapping
is to use better placement algorithms.
There is already a crude attempt at this in TBasicPointSeries.DrawLabel
procedure -- it skips drawing label if it overlaps with immediately
preceding one. There is much way to go in this direction --
see e.g. http://en.wikipedia.org/wiki/Automatic_label_placement

I have experience with developing label placement algorithms,
and perhaps will implement some for TChart,
but have no plans to do so in the immediate future.
Patches are, as always, welcome ;-)

-- 
Alexander S. Klenin




More information about the Lazarus mailing list