Page 1 of 1

Converting axis values to screen coordinates

Posted: Wed Apr 17, 2013 1:27 pm
by SupportArchives
I'm using ViewXY cartesian chart. I'd like to convert X and Y data values into screen coordinates. How?

Re: Converting axis values to screen coordinates

Posted: Wed Apr 17, 2013 1:32 pm
by ArctionPasi
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);

Re: Converting axis values to screen coordinates

Posted: Thu Oct 09, 2014 7:11 pm
by mattmobilemedtek
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.