SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Answered
1
0

Hi again,

I have a requirement that I need to have different behaviors for mouse double clicks on seperate areas of the graph.

I need to support double clicks on the following
Title
Axes
Legend
GridLinesPanel

I tried subscribing for mouse double clicks on the legend, but i never got those. I also tried to create a customlegend modifier that listened to the modifiedmousedouble click, but that seems to always get hit even when I am not double clicking the legend.

The axes seems to work good, but when I also subscribe to the surface I get 2 double click events.

Any suggestions with this?

Thanks again,
Jason

  • You must to post comments
Best Answer
1
0

Hi Jason,

WPF Mouse Events are subject to tunnelling and bubbling. Which means if something in the visual tree has handled an event, items further down the visual tree won’t receive the event. Please see this article for an explanation, and a workaround.

How to catch left mouse click (or MouseLeftButtonDown) anywhere on the SciChartSurface?

To detect what parts of a SciChartSurface were clicked, you can use our ChartModifier API. Please refer to this FAQ, which links to several other FAQs for a detailed breakdown of detecting double clicks on parts of the chart like axis, chart panel etc….

ZoomExtents on either yaxis or chart

To get a click on a legend, you may need to override the legend templates. Please see this article which shows how to override the legend item template, and get a click notification on the Checkbox:

Tutorial – Custom Legend with Color Picker and Custom Point Markers

To get a click on a chart title, you are going to need to look at the e.OriginalSource or e.Source property of a WPF Mouse Event Handler. This will tell you where the click came from.

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.