Mouse actions in chart "decorations"

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
paultobey
Posts: 21
Joined: Mon Dec 09, 2013 7:27 pm

Mouse actions in chart "decorations"

Post by paultobey » Mon Dec 09, 2013 7:33 pm

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.

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Mouse actions in chart "decorations"

Post by ArctionPasi » Tue Dec 10, 2013 10:11 am

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.
Axis label click and edit
Axis label click and edit
axisLabelEdit.jpg (161.94 KiB) Viewed 8237 times
This code is not in Winform demo app, but you can use the code as a template for labels click detecting. :geek:
LightningChart Support Team, PT

paultobey
Posts: 21
Joined: Mon Dec 09, 2013 7:27 pm

Re: Mouse actions in chart "decorations"

Post by paultobey » Tue Dec 10, 2013 3:48 pm

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.

Post Reply