chart cursor indicator

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
strobbekoen
Newbie
Newbie
Posts: 23
Joined: Tue Feb 10, 2009 12:00 am

chart cursor indicator

Post by strobbekoen » Sat Feb 02, 2013 9:59 pm

Hi,

I am using a 2-pixel-wide vertical cursor in my chart.
The chart is linked to various other components like for example a table, moving the record in the table moves the cursor in the chart to the related postion.
The record in the table corresponds to a colorband in the table.
As shown in the screenshot below.
Moving to a record in the table, moves the cursor to the corresponding position in the chart, which in this case is the starting line of the colorband.
Visually, this is not always very clear if the cursor coincides with the starting line of a colorband in the chart.
So my question is, would it be possible to link the cursor to say, a marker on the bottom axis, for examle, a arrow, or small triangle so it's visually more clear where the cursor actually is ?

Image

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: chart cursor indicator

Post by Yeray » Tue Feb 05, 2013 11:16 am

Hi strobbekoen,

You could draw your triangle or arrow at the OnAfterDraw event. Ie:

Code: Select all

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var tmp : Integer;
begin
  with Chart1.Tools[0] as TColorLineTool do
  begin
    tmp:=Axis.CalcPosValue(Value);
    with ParentChart, ParentChart.Canvas do
      Arrow(false, Point(tmp, ChartRect.Bottom-10), Point(tmp, ChartRect.Bottom), 10, 10, 0);
  end;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply