[Lazarus] TAchart multiple reticules and vertical series alignment

Alexander Klenin klenin at gmail.com
Sat May 29 18:06:02 CEST 2010


On Sat, May 29, 2010 at 17:00, Rick <rick at sloservers.com> wrote:
> There are several things I'd like to do with tachart that I have not yet
> been able to figure out how to do.
>
> Easy one: how can I change the thickness and color of the reticule?

Not so easy, unfortunately.
Currently, you can hack in change of thickness by adding ACanvas.Pen.Width
assignment after line 876 in TAGraph.pas
It would certainly good to set it as a property of TReticuleTool.
However, current reticule design suffers from a kind of schizophrenia,
because ReticuleMode and ReticulePos properties still
belong to TChart due to compatibility concerns.
It is unfortunately very hard to judge the impact of backwards-incompatible
changes in such a relatively rarely used module as TAChart.
So let's take you as a representative sample ;-)
Do you feel it is justified to remove these
properties to get multiple reticules and TReticule.Pen property instead?

As for color, there is another issue:
reticule is meant to be drawn on every cursor move and be visible
across various complex charts. To facilitate that, reticule is drawn with
pmXor mode. So you can not really get a consistent color across the reticule.

> Is there any way to have two reticules,

Currently, if there are several TReticuleTools, the last one "wins" due
to compatibility issues noted above.

> each one to be positioned by
> dragging, so I can display the horizontal distance between them?

However, what you want is not actually a job for reticules,
since they are designed to follow cursor and data points.
It is better performed by dragging TConstantLine-s
In fact, similar feature request has already come up in the past,
so I implemented it now -- see TConstantLineDragTool
and toolsdemo at r25751

> I'd like to display multiple line series, one on top of the other.  Is
> there a way to adjust their relative vertical positions?
> Maybe something like add a new vertical axis for each series and shift
> the axis origin up or down.

This can be done, see "Linear transform" page in axis demo.
Try changing Offset value of catTCelToFahr transformation.
The most serious limitation is that you must calculate the offset (and
scale, if needed),
yourself -- TChart can not do this automatically based on series value range.
This is the main point left for closing two long-standing tracker issues.

-- 
Alexander S. Klenin




More information about the Lazarus mailing list