LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to replace numerics x-axis values with string names on x-axis in graphs.

Solved!
Go to solution

Hi all,

I want to put months name or other names on the x-axis of the graphs as shown in the attachment. How can replace the numeric x-axis values with  string names. Can anyone help for the same.

 

Thanks in advance

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

Hi,

 

I couldn't find a direct way to put stings inside. But with a graph you are able to work with time stamps. Make only the months of a time stamp visible. You can do that by right clicking your graph: properties: - go to the display format tab, chose the time x-axis

- chose under type (left side under axis pull down) absolute time

- select advanced editing mode

- type the format string %<%B>T

 

you will only see the months on the X axis.

 

Hope this helps!

 

Martijn

0 Kudos
Message 2 of 13
(4,717 Views)

well: struggled a little bit using a Graph (but that's maybe just me), found a way to create an example based on XY graph. Saved to earlier version so don't mind the lay out.

Message 3 of 13
(4,705 Views)

K.. 

Thanks.

What should be done if I want to put some strings eg:- defect1, defect,2... etc for bar graphs  for either of the axes?

 

0 Kudos
Message 4 of 13
(4,698 Views)

Also I want to know whether it can be done programmatically?

0 Kudos
Message 5 of 13
(4,689 Views)
Solution
Accepted by topic author Reshu

I responded to your original thread from a while ago. Use the %<%B>T format for the months. This can be changed programmtically by using the XScale.FormatString property in a property node.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 6 of 13
(4,645 Views)

In the more general case, implementation of this idea would help in the future. Please vote for it. 😄 Thanks!

0 Kudos
Message 7 of 13
(4,626 Views)

Up you go!

(It should be noted that even Excel doesn't have this functionality for line/scatter plots)

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 8 of 13
(4,618 Views)

@James.M wrote:

I responded to your original thread from a while ago. Use the %<%B>T format for the months. This can be changed programmtically by using the XScale.FormatString property in a property node.


This assumes that the x-axis is a timestamp and that the markers are aligned with months. Could get complicated. (note that months are not equally spaced in time because they have varying lenght, so there could be surprises)

 

 

Implementation of my idea would make things much simpler, because the months axis could just be 1..12, for example (... or 0..11 if you are thinking zero-based :D)

0 Kudos
Message 9 of 13
(4,605 Views)

Yup, much simpler. The way to do that right now would be to do some simple timestamp creation to match the month.

Example_VI.png

 

 

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 10 of 13
(4,598 Views)