This project is read-only.

Swapping the X and Y axis

Jul 7, 2009 at 10:47 AM

Is there any quick method which will swap the X and Y axis? Or do I have to reload the plotter reading my X values as Y and my Y as X?

Jul 7, 2009 at 11:50 AM
Edited Jul 7, 2009 at 11:51 AM

What do you mean saying 'swap x and y axis'? Do you want chart is drawn with x values taken from ys from datasource, and vice versa?

If so, you can create a new descendant of DataTransform class and pass it to Viewport by the following code:


var newCoordinateTransform = plotter.Viewport.Transform.WithDataTransform(new SwapTransform() /* you should write this class*/ );

plotter.Viewport.Transform = newCoordinateTransform;

This descendant in its ViewportToData and DataToViewport methods should swap xs and ys and vice versa.

I hope this will work, if not - report here.


If I'm wrong, a picture can help me ))


Best regards,