Hello,
I have a chart where I am using a custom axis. I use the OnClickAxis event and I cannot find any way to know that the axis I clicked is the custom Axis. Any help will be mostly appreciated
Kindest regards
About Custom Axis
Re: About Custom Axis
Hi johnnix,
The following code seems to work fine.
Could you please send us a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
The following code seems to work fine.
Code: Select all
procedure TForm1.Chart1ClickAxis(Sender: TCustomChart; Axis: TChartAxis;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var i: Integer;
begin
for i:=0 to Chart1.Axes.Count-1 do
if (Axis = Chart1.Axes[i]) then showmessage('clicked ' + IntToStr(i));
end;
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: About Custom Axis
Hello Yeray,
Maybe I was not clear enough What I need to do is to identify that the axis I clicked is my custom axis. In the ClickAxis event I can check the Horizontal property of Axis to determine if it is the X or Y axis but there is no property like IsCustom!!! Is this clear?
Regards
Maybe I was not clear enough What I need to do is to identify that the axis I clicked is my custom axis. In the ClickAxis event I can check the Horizontal property of Axis to determine if it is the X or Y axis but there is no property like IsCustom!!! Is this clear?
Regards
Re: About Custom Axis
Hello,
Just figured out that Axis.Index is -1 for default axis so by checking this value I know if I clicked on the custom Axis.
Regards
Just figured out that Axis.Index is -1 for default axis so by checking this value I know if I clicked on the custom Axis.
Regards
Re: About Custom Axis
Hi johnnix,
I'm glad to see that you've found it! Thanks for sharing.
I'm glad to see that you've found it! Thanks for sharing.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: About Custom Axis
Hello Yeray,
No problem, just consider adding a property e.g. IsCustom !!!
Regards
No problem, just consider adding a property e.g. IsCustom !!!
Regards
Re: About Custom Axis
Hi jonnyx,
There is already a private IsCustom function but making it public needs some adjustments because right now it fails if you remove some of the default axes.
I've added it to the wish list to be revised for further releases (TV52014703).
There is already a private IsCustom function but making it public needs some adjustments because right now it fails if you remove some of the default axes.
I've added it to the wish list to be revised for further releases (TV52014703).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |