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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

[SF.Chart] Issue with Chart.PointToValue on DateTimeAxis shifted of 2 days...

Thread ID:





115766 Feb 5,2014 04:58 AM UTC Feb 6,2014 11:08 AM UTC WPF 2
Tags: Chart
Rodolphe Billottet
Asked On February 5, 2014 04:58 AM UTC



I'm starting to use SF.Chart. I was using traditional LineChart before.

It's basic chart  with a DateTimeAxis as PrimaryAxis and NumericalAxis as SecondaryAxis.

I want to display information on the current point  on Series.MouseMove event like below.

But the function Chart.PointToValue(..) return a wrong value. The date is shifted by 2 days..   How can I fix that..

I have attached a sample


Best regards,


Code snippet [C#]:

void SeriesMouseMove(object sender, System.Windows.Input.MouseEventArgs e)
     var point = e.GetPosition(this.lineChart);
     double xValue = this.lineChart.PointToValue(this.lineChart.PrimaryAxis, point);
     var date = DateTime.FromOADate(xValue);


Rodolphe Billottet
Replied On February 6, 2014 04:57 AM UTC



It seems that I solved the issue with the following transformation:

             var point = e.GetPosition(this.lineChart);

            point.X = point.X - (yAxis.ActualWidth + lineChart.Margin.Left);

            double xValue = this.lineChart.PointToValue(this.lineChart.PrimaryAxis, point);


Can you confirm ?


What the point to have a method 'Chart.PointToValue' if we need to do such transformation ??

You should update the online documentation which is wrong..






Karthikeyan V [Syncfusion]
Replied On February 6, 2014 11:08 AM UTC

Hi Rodolphe,

Thank you for the update.

We have analysed your reported query. You can achieve your requirement with the help of below code snippet.
Code snippet [C#]:
private void SfChart_MouseMouse(object sender, MouseButtonEventArgs e)
SfChart SER = e.Source as SfChart;
Point pt = e.GetPosition(SER.Series[0]); // To get exact position by Chart instance as a replacement for by Series.
YPoint = (SER.PointToValue(SER.SecondaryAxis, pt));
XPoint = (SER.PointToValue(SER.PrimaryAxis, pt));
var date = DateTime.FromOADate(XPoint);
And the codes suggested by you is not appropriate solution for this requirement, since this solution may be fail in case of multiple axes with chart.

Query 2: Documentation issue.

Thank you for your feedback. We will modify the mentioned page in our documentation and we will update the modified details in our upcoming release.

Please let us know if you require further assistance on this.

Karthikeyan V.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon