Page 1 of 1

Marks at the axis

Posted: Fri Dec 07, 2007 12:25 pm
by 9349911
Hi support,

a user asked me the following question ...
Is it possible to have little marks direktly at the Y Axis to show the actual cursor position?

Here you can find a userpic. The small marks are painted into the chart by the user.

http://www.putfile.com/pic.php?img=7230890

Posted: Fri Dec 07, 2007 1:01 pm
by narcis
Hi Dominik,

You can do that directly drawing on the chart's canvas, something like this:

Code: Select all

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
var i: Integer;
begin
  Chart1.Draw;

  Chart1.Canvas.Pen.Width:=2;
  for i:=0 to Chart1.CustomAxes.Count -1 do
  begin
    Chart1.Canvas.Line(Chart1.CustomAxes[i].PosAxis -2, Y,
                        Chart1.CustomAxes[i].PosAxis +5, Y);
  end;
end;

Posted: Fri Dec 07, 2007 1:15 pm
by 9349911
Hi Narcis,

I will try this. Thx for your help !

Amazing support ! :D