Swap X and Y axes

Need help in implementing some specific function to your LightningChart Ultimate powered application? Post a question and get code snippets from other LightningChart Ultimate community members.

Moderator: Queue Moderators

Post Reply
vifani
Posts: 49
Joined: Thu May 02, 2013 8:35 am

Swap X and Y axes

Post by vifani » Thu May 02, 2013 8:51 am

Hi all,

I need to show an FFT graph in a way similar to the "Audio L+R,area,spectrograms" demo, but in an horizontal way.
I have already rotated the AreaSpectrumMonitor, but I need to show the Spectrogram2D chart in horizontal orientation. Rotating the whole graph is not a good choice because all labels are also rotated and are not readable.

Is there a way to swap X and Y axes ?

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

Re: Swap X and Y axes

Post by ArctionPasi » Thu May 02, 2013 3:10 pm

Hello!

set View3D.Camera.RotationZ = 0, and set the View3D.Dimensions in the other way. See also 3D examples / Advanced / Spectrogram example. :freak:
LightningChart Support Team, PT

vifani
Posts: 49
Joined: Thu May 02, 2013 8:35 am

Re: Swap X and Y axes

Post by vifani » Thu May 02, 2013 3:17 pm

I am sorry, but I made a mistake in my first post.

I have already rotated the Spectrogram2D using the camera rotation, but how I can swap axes for AreaSpectrumMonitor that is a 2D chart?

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

Re: Swap X and Y axes

Post by ArctionPasi » Fri May 03, 2013 6:45 am

Ok... If you are using WPF, apply RotationTransform of 90 degrees to chart's RenderTransform or LayoutTransform property.

If using WinForms, you'll need to replace AreaSeries with PolygonSeries, and set the series Y values as PolygonSeries X values and X valus as PolygonSeries Y values. Then add points to the base level X = 0 and connect last series point with the first.
LightningChart Support Team, PT

Post Reply