LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform graph with broken (or segmented) X axis

Solved!
Go to solution

There is no way I know of to have an X axis with unequal spacing like that where you skip over a long range of numbers in a very short space.

 

If you want something like that, I think you'll need to build up your own graphics in a picture indicator.

0 Kudos
Message 11 of 18
(1,516 Views)

RavensFan wrote:

If you want something like that, I think you'll need to build up your own graphics in a picture indicator.


 

Could you develop what you mean please?

0 Kudos
Message 12 of 18
(1,515 Views)

I'm not going to create an example because I think it is too much work.

 

But if you look through the graphics palette, you'll see there are a bunch of picture drawing functions.  You'd need to fill your picture with a grey background using a draw rectangle.  Draw a black rectangle to be your graph background.  Draw in short lines at the appropriate locations to be tick markers on the axis.  (It will be a fair amount math to determine the locations.)  Use the draw text functions to put the numbers in.  Then finally, use the draw lines functions (again using math to translate your X, Y's of your data to X, Y pixel locations in the picture) to draw your wave segments.

 

It would be a lot of work, but certainly doable.  I would make a nice package of subVI's to do all the lower level math calculations so those details can be abstracted out.

0 Kudos
Message 13 of 18
(1,513 Views)

Another approach which might get you close is to use two XY graphs. Make one transparent and use arbitrary marker spacing on the x-axes. It will still take a fair amount of work with property nodes to get the scales the way you want, if it is even possible.

 

Overlay graphs.png

 

Note that the Xmin and Xmax scale values have both graphs' values overlapping.

 

Here is what it looks like at an intermediate step in the process.

 

Transparent graph.png

 

Lynn

 

0 Kudos
Message 14 of 18
(1,507 Views)

@MattWSU wrote:

@BTC_Admin wrote:

Ah ok.  Try the connection I am showing in attached image (since I don't have your code, I have edited your image- might have been easier to edit the code):


I have tried what you suggest, but it does not do what I want. I have also added the vi of the test file I have made. That should help.


I hope the vi file will help to understand.

Thank you for help


 

Actually if you followed what I suggested, it is possible to do what you're meaning to get out of a waveform or an XY Graph (yes, you can "create" a broken X-axis with little bit of trick- although if you're new to LabVIEW then you may experience a bit of difficulty.)

 

Attached is another example without doing any additional graphical tricks (well, a very tiny one) - I took your vi with waveform indicator in it, got rid of unnecessary items and made the graph look just like how you wanted:  plot0 has scale 10~20 and plot1 has scale 90~100.  Copy that graph "as-is" to your own application (drag it from the vi I have attached to your vi) and simply follow the logic I have shown.  If you have more than 10 data points, you'll need to play with X-axis scaling - like I mentioned earlier, you can have multiple X-axis and you'll have to learn a little bit on how to "manipulate" them look like an X-axis with "special" scale.  It is also very much possible to implement configurable time-scale/etc (or if you want to specify scale for each plot, do that through property nodes) - possibilities are limitless!

 

Good luck, sorry I don't have time to polish my example vi and make it perfect for your application, but it is very close.

 

-DP

(Hey I deserve a kudo for that! Smiley Happy)

Untitled.png

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 15 of 18
(1,490 Views)

BTC_admin wrote:

Hey I deserve a kudo for that! :smileyhappy:


 

You are very close to get a kudo indeed Smiley Happy

I said very close because the ranges 10-20 and 90-100 were for the shake of the example. Indeed, those values change every time the program is run. Therefore, I need to dynamically allocate the X axis depending on the number and range of each "mini-measurement". I'm very familiar with the property nodes, but I just would like you to give me a little more information on how to create/manipulate the different parts. I think I understand the general idea (create different x axis which are then displayed back to back). However, I can't figure out which property node to use (there are a lot of them as you know). So, I would appreciate if you can point me in the right direction.

 

Thanks!

 

0 Kudos
Message 16 of 18
(1,467 Views)
Solution
Accepted by topic author MattWSU

There is a "Active X scale" property that you first set, and then set the range/etc for that particular Xscale.

 

-DP

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


Message 17 of 18
(1,460 Views)

Oh man, that's super neat!

 

Thanks a lot!

0 Kudos
Message 18 of 18
(1,452 Views)