We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Highlighting nearest Datapoint

Hi,
We are trying to highlight the nearest datapoint in a wpf line chart, and all our attempts have been unsuccessful.
The chart consists of 3 series of points. We have a tooltip when you hover a point (using the highlight property), but another requirement states that we should highlight the nearest point of the series when the mouse is not over the series.
Requirement: When the mouse is placed over the main chart area, the closest data point in terms of time should be highlighted with a small circle on each time series. This is done by taking only the x axis value of the mouse pointer position and highlighting the data point on each time series that has the closest x axis value on the chart. As the mouse pointer is moved around, the highlighted data points change in real time.
(note: Google finance has a good example of this.)

If there’s an easy way please let us know.
For what I could see, maybe we could achieve it if we could get the screen coordinates of an IChartDataPoint, but the X, Y on that class are not screen coordinates. Another way could be to get the ChartSegment of a point (point.ParentSegment it’s always null… maybe there’s something missing in my template?)

Any help will be appreciated.
Regards

4 Replies

CS C. Sudha Syncfusion Team October 30, 2009 11:11 AM UTC

Hi Matthew,

Thanks for choosing Syncfusion product.

I am working on this. I will update you on monday with the sample. Thanks for your patience.

Please let me know if you have any questions.

Regards,
SudhaC.


MM Matthew Monks November 3, 2009 10:53 AM UTC

Hi Sudha,

Any updates on this issue?

Thanks!


PI Poorani Idhaya Bala M.A Syncfusion Team November 4, 2009 02:01 PM UTC

Hi,

Thanks for choosing Syncfusion Products.

Sorry for the delayed update.I am working on this.I have completed the sample,but some issues are there.So, I will update you the sample by tomorrow.

Thanks,
Poorani



PI Poorani Idhaya Bala M.A Syncfusion Team November 5, 2009 05:24 AM UTC

Hi Matthew,

Thanks for choosing Syncfusion Products.

Sorry for the delayed update.

You can achieve your requirement using the chart annotation labels.Please find the attached sample.

Please test this at your end and let me know if you have any questions.


Thanks,
Poorani



CS_748de96f.zip

Loader.
Live Chat Icon For mobile
Up arrow icon