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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get coordinates of x and y in WPF Chart (SfChart)?

Platform: WPF |
Control: SfChart |
.NET Framework: 4.5 |
Product Version:

You can get the coordinates of x and y axes using the MouseDownClick event in WPF Chart (SfChart). In this example, the Mouse.GetPosition(ChartName) gets the x and y coordinates of the window and then converts the coordinates point to value using the PointToValue function.


<!--The co-ordinates of x and y were shown on MouseDown Event-->
<Syncfusion:SfChart Name="ScatterChart" MouseDown="ScatterChart_MouseDoubleClick" Width="700" Height="500">


private void ScatterChart_MouseDoubleClick(object sender, MouseButtonEventArgs e)
  Point position = new Point { X = e.GetPosition(ScatterChart).X - ScatterChart.SeriesClipRect.Left, Y = e.GetPosition(ScatterChart).Y - ScatterChart.SeriesClipRect.Top};
  //PointToValue converts window coordinates to chart X,Y coordinates
  double xValue = this.ScatterChart.PointToValue(this.ScatterChart.PrimaryAxis, position);
  double yValue = this.ScatterChart.PointToValue(this.ScatterChart.SecondaryAxis, position);
  MessageBox.Show("X: " + xValue + "\n" + "Y: " + yValue);


WPF Chart displays X and Y Coordinates



2X faster development

The ultimate WPF UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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

Live Chat Icon For mobile