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

Show X and Y values under mouse cursor

Thread ID:





100892 Sep 13,2011 07:18 AM UTC Jun 4,2012 01:40 PM UTC ASP.NET Web Forms (Classic) 5
Tags: Chart
Ashish Mondal
Asked On September 13, 2011 07:18 AM UTC

Is there is way to show the X and Y values of a chart under the the mouse cursor when we hover the mouse over a chart?

Sivakumar D [Syncfusion]
Replied On September 13, 2011 08:30 AM UTC

Hi Ashish,

Thanks for using syncfusion products.

We suggest you to use Tooltip property of series to get the X and Y values of the chart.Please refer below code snippet.


this.ChartWebControl1.ShowToolTips = true;
series.PointsToolTipFormat = "{2}";
for (int i = 0; i < series.Points.Count; i++)
series.Styles[i].ToolTip = string.Format("X = {0}, Y = {1}", series.Points[i].X.ToString(), series.Points[i].YValues[0]);

For more information about tooltip,please refer our online documentation links below.



For your convenience, we have created sample and the same can be downloaded from the following link.


Please let me know if you have any other questions or concerns.


Ashish Mondal
Replied On September 13, 2011 08:44 AM UTC

Thanks for the quick response.

But I want to show the X-Y values even when there is nothing plotted on the chart.

That is, the X-Y values shown will correspond to actual location of mouse cursor on the graph.

Also, the tool tip should be visible for as long as the mouse is over the chart.

Sivakumar D [Syncfusion]
Replied On September 13, 2011 01:58 PM UTC

Hi Asish,

Thanks for your update.

We are sorry for inconvenience caused.In our current implementation of chartwebcontrol doesn't support to show the actual location of x and y values when there is nothing plotted on the chart.Tooltip property of series is displayed only when there is a points in the chart and also tooltip is visible as long as mouse over the points in the chart.

Please let me know if you have any other questions or concerns.


Replied On June 4, 2012 04:05 AM UTC

Hi Siva,

This is Hari, I have a similar requirement as Asish mentioned but I am using syncfusion charts in WPF and I am able to show the tool tip on the deviation on the chart i.e., on change in angle inclination/declination, I have a requirement that I have to show the toop tip when ever we place mouse pointer on the chart irrespective of the plotted areas we need to take Horizontal and Vertial cline which bisects/touches the plotted points and need to show the point of intersection on the toop tip., It would be great help if you could tell me is it possible to show..,




Sivakumar D [Syncfusion]
Replied On June 4, 2012 01:40 PM UTC

Hi Ashish,

Thanks for your update.

We suggest you to use PrepareStyle event of ChartSeries to show the X any Y values for each point when mouse over the chart. When a series point is about to be rendered by the chart, it will raise this event and allow event subscribers to change the style used.

We can use GetValueByPoint and   GetPointByValue method of Chart Area to get the X and Y values for each point in the chart. Please refer below code snippet.

void series_PrepareStyle(object sender, ChartPrepareStyleInfoEventArgs args)
        ChartSeries series = sender as ChartSeries;
        if (series != null)
            ChartPoint chpt = new ChartPoint(series.Points[args.Index].X, series.Points[args.Index].YValues[0]);
            Point pt = ChartWebControl1.ChartArea.GetPointByValue(chpt);
            ChartPoint cpoint = ChartWebControl1.ChartArea.GetValueByPoint(pt);

            args.Style.ToolTip = "Chart Point - " + chpt.ToString() + "<br/>Result of method GetPointByValue - " + pt.ToString() + "<br/>Result of method GetValueByPoint - {" + cpoint.X.ToString() + "," + cpoint.YValues[0].ToString() + "}";

For more information about PrepareStyle event, Please refer our online documentation link below.


Online Sample link:


Please let me know if we misunderstood your requirement.




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