Jump to content
Software FX Community

Relate a point to values on series?


kelias

Recommended Posts

I'm trying to implement behaviour similiar to google finance where a user moves the mouse over a chart and it tracks on each series and displays the values for each series on the top of the chart.

I can use the HitTest method of the chart in the MouseMove event to determine when the user is in the Plot Area, but I can't find a nice way to determine what the value of each series should be.

Is there a simple way to take a Point object and determine what value for each series would match with it? 

 

Link to comment
Share on other sites

The approach to get the value of each series depends on how are you passing the data to the chart

- Is the X axis showing dates?

- Are you using a gallery that supports X values? e.g in a line chart with points on the following dates: Jan 1, Jan 2 and Jan 18, the distance between the first 2 points will be smaller than the distance between the second and third point.

Regards,

JuanC

Link to comment
Share on other sites

  • 2 months later...

We build a small sample but forgot to add it to this thread. Hope it helps

Note that this is important that the 2 private members (m_hasXData and m_differentCountPerSeries) are set according to your data, for example in the OnXValues handler we plot XY data (similar to what you are probably doing using dates) and each series have a different number of points so wet set both variables to true.

JuanC

Code and XAML attached.

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.

×
×
  • Create New...