Page 1 of 1
OnClick event for arrow in TArrowSeries
Posted: Thu Dec 20, 2012 3:37 pm
by 5886551
Hi all,
Is there an event for clicking on (or moving over) an arrow in a TArrowSeries? I can only click on the start point of the arrow but not on the arrow. I would like to implement that the cursor changes to crHandPoint if it is over an arrow and to show some data in a popup window if the arrow is clicked. Possible?
Thanks in advance for any help!
Best regards,
Rolf
Re: OnClick event for arrow in TArrowSeries
Posted: Thu Dec 20, 2012 6:26 pm
by 5886551
It seems to be a bug in an older version. In C++Builder XE2 with TChart Std v2011.03.32815 it's working! I used OnMouseEnter and OnMouseLeave to set the cursor style.
But when I click the button of the popup window to close it, a white zoom frame is drawn from the point where I clicked the arrow to the point where I closed the popup window. How can I prevent this (the drawing of the zoom frame)? I have to click again to get rid of the zoom frame but then the chart is zoomed what wasn't intended.
A possible workaround: I could deactivate zooming and add a button to enable zooming.
Best regards, Rolf
Re: OnClick event for arrow in TArrowSeries
Posted: Fri Dec 21, 2012 3:02 pm
by yeray
Hi Rolf,
Rolf Fankhauser wrote:But when I click the button of the popup window to close it, a white zoom frame is drawn from the point where I clicked the arrow to the point where I closed the popup window. How can I prevent this (the drawing of the zoom frame)? I have to click again to get rid of the zoom frame but then the chart is zoomed what wasn't intended.
I've tried the following code but I don't see this effect:
Code: Select all
uses ArrowCha;
procedure TForm1.FormCreate(Sender: TObject);
begin
with Chart1.AddSeries(TArrowSeries) as TArrowSeries do
begin
FillSampleValues(5);
ArrowWidth:=32;
ArrowHeight:=24;
end;
end;
procedure TForm1.Chart1ClickSeries(Sender: TCustomChart;
Series: TChartSeries; ValueIndex: Integer; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
with TForm.Create(Self) do
begin
Width:=100;
Height:=100;
Left:=Form1.Left+Chart1.Left+X-50;
Top:=Form1.Top+Chart1.Top+Y;
ShowModal;
end;
end;
Could you please modify the code above or arrange a simple example project we can run as-is to reproduce the problem here?
Rolf Fankhauser wrote:A possible workaround: I could deactivate zooming and add a button to enable zooming.
It sounds as a possible workaround. However, if we can reproduce the problem here we'll study if disabling the zooming feature at OnMouseEnter or some other event solves the problem too.