LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change direction (swap axes) of Intensity Chart

Solved!
Go to solution

I have used an intensity graph to display frequency vs time. 

 

What i would like to do is change the direction of the updates. Currently Frequency is on the y axis, time is on the x axis, and new values are added on the right. 

 

I would like to have Frequency on the x-axis, and Time on the y-axis. Not really fussy as to whether the graph flows down or up, but I would like to flip the axes

 

Is this possible? It should be quite simple to implement but I havent been able to find a way to do it

 

 

 

0 Kudos
Message 1 of 12
(4,737 Views)

Hi benny,

 

in your topic line you mention an "intensity chart", while in the message text you write "intensity graph". What exactly are you using?

(Attaching a VI or snippet would be so much better than just attaching images…)

 

With a chart you cannot flip axis as you intend to do.

With a graph it is possible by reorganizing the array data you supply to the graph!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(4,701 Views)

Could you use a Property Node implicitly linked to the Chart or Graph and write True to the property of "Transpose Array"..

 

Give that a try..

CLD | CTD
0 Kudos
Message 3 of 12
(4,696 Views)

Hi Chris,

 

the chart will still add/append new data along the x axis...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 12
(4,691 Views)

I'm not sure I can find it, now, but there was a Blog article that discussed using Graphs instead of Charts, particularly if update rates were slow (like 10 Hz or lower), the notion being you have a circular buffer, add points in one at a time, and plot the entire buffer (either "unrolled", making a scrolling "chart", or in place, making a "sweep chart").  If you are going to do that, then sure, transpose the array before plotting it, and you've interchanged the X and Y axes.

 

Bob Schor

0 Kudos
Message 5 of 12
(4,682 Views)

Apologies GerdW, I am using an intensity chart. So the answer seems to be that it is not possible.

 

In response to the suggestion to transpose the array - that does not work as it still updates along the x axis. 

 

It seems ridiculous that you cant do something as simple as rotate a control (or flip the axes) Especially when, after doing a bit of a search, found that people have been asking for at least 5 years

 

I am a fan of LabVIEW but something as simple as this going unimplemented is unacceptable in my opinion. It makes me frustrated with the whole LabVIEW environment. 

 

I hope there is a very good reason for not doing this that I am not seeing. 

0 Kudos
Message 6 of 12
(4,667 Views)

Bob_Schor any chance you have a link to this blog handy?

 

The update rates dont need to be terribly high - In fact I want to slow them down from the current rate and provide some sort of integration (averaging) 

0 Kudos
Message 7 of 12
(4,664 Views)

You are in luck:  http://culverson.com/tips-and-tricks/ .  I've played with this a bit, and I really like it -- I've gotten some impressive "Chart-like" responses at multiple time bases, multiple selectable channels, while taking (simulated) 4-channels of data at 500 Hz (the original spec called for 4 channels at 50 Hz for up to several hours, but when you run it 10 times faster, you don't have to wait as long to see some of the longer time axes become effective ...).

 

Bob Schor

0 Kudos
Message 8 of 12
(4,647 Views)
Solution
Accepted by topic author bennymacca

Thanks for your reply bob - fortunately I ended up implementing the solution myself anyway. 

 

Surprisingly it wasnt that painful - which actually makes me even more annoyed that this isnt a standard feature of LabVIEW by now

 

I found this from way back in 2006 and used it as my starting point

http://www.ni.com/example/25994/en/ 

 

My code is attached. 

 

It allows for the graph to be reset in real time, and to change the amount of history displayed (currently this also clears the graph but it would be straightfoward to change this and keep the data there)

 

Hope this helps someone!

 

 

 

 

 

 

0 Kudos
Message 9 of 12
(4,634 Views)

Hi Benny,

 

which actually makes me even more annoyed that this isnt a standard feature of LabVIEW by now

A chart always displays data along the x axis - why should NI change this behaviour?

With a graph the programmer has (more or less) full control over the displayed data so it's your task to decide which direction you want to take! (And again NI doesn't need to change anything.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 12
(4,588 Views)