Jump to content
Software FX Community

Capturing values of data points


Dinosaur
 Share

Recommended Posts

Hi,

I need help on capturing the values of any data point in a chart. Essentially, I need the information displayed in the tooltip when you hover over a data on a line chart. I have a chart with 4 series on a realtime axis, with datasource being an xml file. I'm looking to get the x value and the y value all of the series when the mouse hovers over (or clicks) a data point. Can someone help me with this please? Thanks.

shirley

Link to comment
Share on other sites

Both the MouseClick event and the GetTip event provide you with all the information you need to determine which point is being clicled/hovered-over.

For example:

private void chart1_MouseClick (object sender,HitTestEventArgs e) {

if (e.HitType == HitType.Point) {

   int seriesClicked = e.Series;

int pointClicked = e.Point;

double x = chart.Data.X[seriesCliecked,pointClicked];

double y = chart.Data.Y[seriesCliecked,pointClicked];

  }

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...