LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing Chart Scale with Strings

I'm attaching a very simple VI I wrote that graphs and saves an image of a spreadsheet I use.  I'm also attaching an example spreadsheet so anyone can see how it works.

 

The X-Axis actually needs to be a string, not a number.  I am currently listing the strings at the top and showing which number they relate to.  I would like to replace the numbers at the bottom of the chart with the strings that belong in those spots.  I found 1 post that talked about being able to do this, but didn't understand it very well.  Can anyone tell me how to replace the X-Axis values with these strings?

 

Thanks.

Jeremy Backer
CLAD
Download All
0 Kudos
Message 1 of 11
(5,004 Views)

In this thread I posted code that does this.

 

 

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 11
(4,997 Views)

That's pretty good, and worked well.  However, the exported image doesn't show the picture your VI makes (X values).  It shows the original scale.  I print this exported image so I can show shop floor associates the info.

 

Is there a way to actually change the chart scale to strings?

Jeremy Backer
CLAD
0 Kudos
Message 3 of 11
(4,983 Views)

JMBacker wrote:

That's pretty good, and worked well.  However, the exported image doesn't show the picture your VI makes (X values).  It shows the original scale.  I print this exported image so I can show shop floor associates the info.

 

Is there a way to actually change the chart scale to strings?


 

No not yet.

 

You could grab an image of the FP and crop it down?

 

Just trying to help,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 11
(4,973 Views)

Yeah, I'll keep working on it.

 

Thanks for the help.

Jeremy Backer
CLAD
0 Kudos
Message 5 of 11
(4,971 Views)

I have taken the liberty of modifying Ben's example to export the graph to a JPEG file.

 

 

Message 6 of 11
(4,956 Views)
Well, thank you very much Darin.
Jeremy Backer
CLAD
0 Kudos
Message 7 of 11
(4,938 Views)

Good!

 

Darin,

 

Could you please duplicate some of teh tags i added? This way we can find your work agian latter when the next person asks.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 11
(4,910 Views)
For all of you that would prefer native support for text based axes, make sure to support my Idea!. 🙂
0 Kudos
Message 9 of 11
(4,903 Views)

Here's what I came up with for my particular application.  I used the caption since it gets exported with the graph image, moved it to the bottom of the graph, sized it the same width as the graph, changed the vertical arrangement, then counted how many lines it took to fill the whole width of the graph.  I initialize an array this size, then devide how many entries I have by the total number of lines to fill, take out the extra spaces at the beginning, and insert each entry at the correct index in the string array.  I think it might make more sense when you look at the block diagram.

 

It doesn't line the descriptions up perfectly, but it's always pretty close.  Close enough to figure out what is what.  Hope this helps some of you.

Jeremy Backer
CLAD
Message 10 of 11
(4,882 Views)