Nevron Forum

How to distinguish objects which receive mouseclick?

https://www.nevron.com/Forum/Topic3860.aspx

By Alex Efimov - Friday, July 23, 2010

Hi.
I have a line series displayed on a chart. I've subscribed to the MouseClick event of the NChartControl instance.
When I get the event handler invoked, I perform a HitTest which returns a NHitTestResult object.
I want to know somehow if the user clicked the line or the marker point. Is there a way to get such a distinction?

Thanks in advance,
Alexander Efimov.
By Nevron Support - Monday, July 26, 2010

Hi Alex,
The line series will record markers and line segments as visual elements that belong to a "data point". In general all series behave like this as the lowest "precision" of the internal image map in the chart is data point - therefore the chart cannot distinguish if the item clicked is a line segment or a marker. You can easily workaround this limitation by using a second point series with the same values as the line series instead of using markers.

By Alex Efimov - Monday, July 26, 2010

Thank you very much for the answer.