I am using TPointSeries with setting the Marks visible.
And I want to do sth. when Marks clicked,
is there some event like OnMarkClick()?
Thanks in advance.
Is there a OnMarkClick() event?
Re: Is there a OnMarkClick() event?
Hello,
There's a clicked function for the Marks, so you could use the Chart's OnMouseDown event as follows:
There's a clicked function for the Marks, so you could use the Chart's OnMouseDown event as follows:
Code: Select all
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
Caption:=IntToStr(Chart1[0].Marks.Clicked(Round(X), Round(Y)));
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Is there a OnMarkClick() event?
Thank you.
And one more question about TAxisArrowTool.
I want to know if TChart or TAxisArrowTool is doubleclicked.
And the events were triggled as below when the TAxisArrowTool doubleclicked.
So I set a flag for TAxisArrowToolClick (1), then check the flag when Chart1DblClick (2) triggled,and clear the flag.
But the flag is set again by (3).. so if I doubleclicked the TChart after (3), it result in that TAxisArrowTool was doubleclicked..
Is there any better idea?
Thanks in advance.
And one more question about TAxisArrowTool.
I want to know if TChart or TAxisArrowTool is doubleclicked.
And the events were triggled as below when the TAxisArrowTool doubleclicked.
So I set a flag for TAxisArrowToolClick (1), then check the flag when Chart1DblClick (2) triggled,and clear the flag.
But the flag is set again by (3).. so if I doubleclicked the TChart after (3), it result in that TAxisArrowTool was doubleclicked..
Is there any better idea?
Code: Select all
TAxisArrowToolClick (1)
Chart1DblClick (2)
TAxisArrowToolClick (3)
Re: Is there a OnMarkClick() event?
Hello,
This sounds as a completely different question. Please, try to create different threads for different questions as indicated in the instructions in my signature.
I've done a simple tests, and adding a boolean variable as follows I seem to be able to check when the arrow has been doubleclicked:elmec wrote:And one more question about TAxisArrowTool.
I want to know if TChart or TAxisArrowTool is doubleclicked.
Code: Select all
var dbClick: bool=false;
procedure TForm1.Chart1Click(Sender: TObject);
begin
dbClick:=false;
Memo1.Lines.Add('Chart Click');
end;
procedure TForm1.Chart1DblClick(Sender: TObject);
begin
dbClick:=true;
Memo1.Lines.Add('Chart DblClick');
end;
procedure TForm1.ChartTool1Click(Sender: TAxisArrowTool; AtStart: Boolean);
begin
if dbClick then
begin
Memo1.Lines.Add('Arrow DblClick');
dbClick:=false;
end
else
Memo1.Lines.Add('Arrow Click');
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Is there a OnMarkClick() event?
Thank you.
But I also want to do sth.
when just doubleclicking the TChart, not the TAxisArrowTool,
so I want to know which is doubleclicked when TChartDblClicked event triggled.
But I also want to do sth.
when just doubleclicking the TChart, not the TAxisArrowTool,
so I want to know which is doubleclicked when TChartDblClicked event triggled.
Re: Is there a OnMarkClick() event?
In a word, I want to do sth. as below in Chart1DblClick function.
Code: Select all
void __fastcall TForm12::Chart1DblClick(TObject *Sender)
{
if (AxisArrowClicked)
do sth.
else
do sth.
}
Re: Is there a OnMarkClick() event?
Hello,
You can play further with the events to find what you are looking for.
If I understand you correctly, this would achieve it:
You can play further with the events to find what you are looking for.
If I understand you correctly, this would achieve it:
Code: Select all
var chartClicked: bool=false;
chartDblClicked: bool=false;
arrowClicked: bool=false;
arrowDblClicked: bool=false;
myMouseDown: TPoint;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.Pages.MaxPointsPerPage:=5;
end;
procedure TForm1.Chart1Click(Sender: TObject);
begin
chartDblClicked:=false;
arrowDblClicked:=false;
chartClicked:=true;
end;
procedure TForm1.Chart1DblClick(Sender: TObject);
begin
chartDblClicked:=true;
end;
procedure TForm1.ChartTool1Click(Sender: TAxisArrowTool; AtStart: Boolean);
begin
if chartDblClicked then
begin
arrowDblClicked:=true;
chartDblClicked:=false;
end
else
begin
arrowClicked:=true;
chartClicked:=false;
end;
end;
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
myMouseDown.X:=X;
myMouseDown.Y:=Y;
end;
procedure TForm1.Chart1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if chartClicked then
Memo1.Lines.Add('Chart Clicked');
if arrowClicked then
Memo1.Lines.Add('Arrow Clicked');
if chartDblClicked then
Memo1.Lines.Add('Chart Double Clicked');
if arrowDblClicked then
Memo1.Lines.Add('Arrow Double Clicked');
chartClicked:=false;
arrowClicked:=false;
chartDblClicked:=false;
arrowDblClicked:=false;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |