Converting axis values to screen coordinates
Moderator: Queue Moderators
-
- Posts: 16
- Joined: Tue Mar 26, 2013 11:01 pm
Converting axis values to screen coordinates
I'm using ViewXY cartesian chart. I'd like to convert X and Y data values into screen coordinates. How?
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Converting axis values to screen coordinates
Use ValueToCoord method of axes.
Code: Select all
float xCoord = m_chart.ViewXY.XAxes[0].ValueToCoord(xValue);
float yCoord = m_chart.ViewXY.XAxes[0].ValueToCoord(yValue);
LightningChart Support Team, PT
-
- Posts: 28
- Joined: Tue Sep 30, 2014 8:06 pm
Re: Converting axis values to screen coordinates
I was doing this, but getting odd results. Then I realized that I needed to wait for the graph to load before the ValueToCoord methods would work.
There's a Loaded event on the chart that you can hook into.
Hopefully this saves someone a little time.
There's a Loaded event on the chart that you can hook into.
Hopefully this saves someone a little time.