Page 1 of 1

Different mouse cursor for different parts of chart

Posted: Tue Feb 17, 2015 12:06 pm
by 16570117
Hi,

is it possible to have different mouse cursor for different parts of chart? In one area I would like to have crHandPoint and in other part I would like to have crDefault. How to do that?

Currently I am handling onMouseMove event and when I detect point is in the rectangle I try to set Chart.Cursor = crHandPoint but somehow gets changed back to crDefault.

Thanks.

Re: Different mouse cursor for different parts of chart

Posted: Tue Feb 17, 2015 2:12 pm
by yeray
Hello,

This seems to work fine for me here:

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.AddSeries(TLineSeries).FillSampleValues;
end;

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  if (Chart1.Legend.Clicked(X, Y)>-1) then
    Chart1.Cursor:=crHandPoint;
end;
Could you please modify the above or to arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.