Jump to content
Software FX Community

Capturing values of data points


Dinosaur

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...