Hi,
I'd like to detect a mouse action (click, double-click, right-click, not sure exact UI yet) on the Y-axis of an XY plot. I can detect this on the axis line itself with no problem, but I believe users will assume clicking on axis labels "means the same thing". Can I distinguish axis label clicks in some way?
I can capture whole-chart clicks but I don't see a method to categorize click locations into labels, legends, etc.
Thanks and best regards,
Paul T.
Mouse actions in chart "decorations"
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Mouse actions in chart "decorations"
Hi Paul,
In general, LC objects have mouse event handlers in them directly. For example, chart.ViewXY.LegendBox.MouseClick/Up/Down/Move/OverOn/OverOff. The event handlers report the object that sent the event. So you can use this approach for most parts.
Axis labels is a different thing, though. They are not mouse-aware. To detect mouse hit on them, some code is needed. In WPF demo application, we have "Axis range edit, value labels" example.
This code is not in Winform demo app, but you can use the code as a template for labels click detecting.
In general, LC objects have mouse event handlers in them directly. For example, chart.ViewXY.LegendBox.MouseClick/Up/Down/Move/OverOn/OverOff. The event handlers report the object that sent the event. So you can use this approach for most parts.
Axis labels is a different thing, though. They are not mouse-aware. To detect mouse hit on them, some code is needed. In WPF demo application, we have "Axis range edit, value labels" example.
This code is not in Winform demo app, but you can use the code as a template for labels click detecting.
LightningChart Support Team, PT
Re: Mouse actions in chart "decorations"
I'll check the code. It's working now based on the assumption that anything outside the axes and not in the legend is part of the "axis" area.
Thanks,
Paul T.
Thanks,
Paul T.