Get ScreenPoint from DataPoint

May 26, 2014 at 9:36 AM
Edited May 26, 2014 at 9:59 AM
Hi everybody,

I'm currently blocked by an issue that is I want to get a list of screen points from the list of data points. My list of data points is filled and is valued but when I apply a tranform to get screen points, the result is always 0,0 per each point. Can you tell me why?

Here is my code :
foreach (DataPoint dp in series.Points)
{
      Console.WriteLine(dp);
      Console.WriteLine(this.xAxis.Transform(dp.X, dp.Y, this.yAxis));
}
And the result in console :
41695 1.3715
0 0
41696 1.3697
0 0
41697 1.37545
0 0
41700 1.37595
0 0
41701 1.37375
0 0
41702 1.3737
0 0
41703 1.37945
0 0
41704 1.3867
0 0
41707 1.3875
0 0
41708 1.38665
0 0
41709 1.3881
0 0
41710 1.3885
0 0
41711 1.389
0 0
41714 1.39145
0 0
41715 1.39265
0 0
41716 1.3882
0 0
41717 1.38045
0 0
41718 1.3784
0 0
41721 1.38145
0 0
41722 1.3831
0 0
41723 1.3803
0 0
41724 1.37595
0 0
41725 1.37455
0 0
41728 1.3762
I made this after giving model to the plot view and after adding series. I add that my x axis is a DateTime axis and my Y axis is a linear axis.

Finally I need to get the real points coordonates.

Thank's for help.
Coordinator
Jun 6, 2014 at 8:29 PM
The transforms on the axes are defined when rendering (since they depend on the width/height of the client area). Are you trying to transform before the plot is rendered? Maybe you can subscribe to the Axis.TransformChanged event and do this after the transform has been set?