ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Chart X axis values as text

Hello all,

I am trying to chart parameters from several different tools, on the same bar graph. I have no problem with charting the data, but would like to have the x-axis display the tool names under each point. The tool names are all alpha-numeric, and I have to be able to display them programmaticly as the tool names change based on input selections.

I am using using LV 7.1.1 but cannot send a sample vi, but I have attached a jpg of one of the charts, and have a couple of tool names pasted in for examples.

any help would be appreciated.

Thanks
Chris
0 Kudos
Message 1 of 7
(3,721 Views)
A simple solution would be to use label cursors. Unfortunately, it is not possible to write the text in a vertical orientation. So, forget it.

A more complicated solution is to overlay a picture on the graph, make it transparent, then draw the strings over the graph bars.

Here is an adaptation of a vi that I used some weeks ago. I think that you can further adapt it to your needs.

CC
Chilly Charly    (aka CC)
Message 2 of 7
(3,716 Views)
Again, but with default values saved...

CC
Chilly Charly    (aka CC)
Message 3 of 7
(3,715 Views)
CC
thank you for the fast and helpful reply. I think I can work with this, and I'm pretty sure I can figure out how to resize the # labels as needed 🙂

But it does bring up a question that I actually received from an alpha tester, and I think your solution will add to the # of times the question gets asked, so I am hoping that you or someone else knows why and or how to fix it. But I noticed that the first and last bars are half width ( the chart frame cuts off half) and in your solution the first label is also clipped in half? I suppose you could put a false first and last value (set to zero) to extend the width the chart. It seems there should be an easier way, is there a format value or something Im missing?

Again thanks for all the help 🙂

Chris
0 Kudos
Message 4 of 7
(3,715 Views)
If you prefer a simpler solution, you could play with the scale of a slide set to "text labels". I have stripped CC's example to show this alternative idea.

(This will just point you in the direction. Please show/hide the regular x-axis scale, tune the alignements, make the slide transparent (so only its scale shows), etc. as desired. Currently, the scale is grouped with the graph.)
0 Kudos
Message 5 of 7
(3,691 Views)
It is possible to move the position of the Xscale, by setting the min and max values at -0.5 and n+0.5 respectively.
Here is a simplified version of the previous vi, that does that automatically.

CC
Chilly Charly    (aka CC)
Message 6 of 7
(3,682 Views)
CC

Once again thank you, looks like the last VI you sent will answer all the complaints I recieved. Assuming of course I can actually impliment them.
I appreciate the timely help!

Chris
0 Kudos
Message 7 of 7
(3,666 Views)