Skip to main content

How to rotate chart (ViewXY)?

Y- and X-axes similar, but not the same. In particular, stacking could be done only for YAxes and scrolling/sweeping is only for XAxis. LightningChart is design such way that Xaxis is always horizontal and progressive order of x-values is required for most of line-series.

Nevertheless, sometimes user may need XAxis be vertical, while YAxis to be horizontal. While it is possible to rename axis, the specific behavior (e.g. stacking Y-axes and scrolling/sweeping X-axes) is not possible to switch inside LightningChart. However, such rotation could be done with WPF RotateTransform Class

To set a graphics transformation following few lines should be added in the code

// Apply rotation of a chart.
var layoutGroup = new TransformGroup();
layoutGroup.Children.Add(new RotateTransform(-90));
chart.LayoutTransform = layoutGroup;

Any example from our Demo could be rotated on fly to demonstrate this rotation feature (buttons outline in the picture below). In ExampleSideSpectrogram, such rotation is done in the code and chart is scrolling vertically when example is started.

ExampleSideSpectrogram ExampleSideSpectrogram

Note

WinForms does not have such feature, so it would be much more difficult to do there.