Converting axis values to screen coordinates

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Arction_LasseP

SupportArchives
Posts: 16
Joined: Tue Mar 26, 2013 11:01 pm

Converting axis values to screen coordinates

Post by SupportArchives » Wed Apr 17, 2013 1:27 pm

I'm using ViewXY cartesian chart. I'd like to convert X and Y data values into screen coordinates. How?

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: Converting axis values to screen coordinates

Post by ArctionPasi » Wed Apr 17, 2013 1:32 pm

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

mattmobilemedtek
Posts: 28
Joined: Tue Sep 30, 2014 8:06 pm

Re: Converting axis values to screen coordinates

Post by mattmobilemedtek » Thu Oct 09, 2014 7:11 pm

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.