LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

match X divisions to label strings

I have a graph, in which I want to display a time format on the X axis. The format of the X values is seconds, the format i want to have is 3d13h24m12s. The labeling of the X axis works OK, however, since the steps of the X labels is in days, or minutes, the values of the grid don't make a lot of sense, because the grid draws lines at 10,000 seconds, 20,000 seconds and so on. This is of course not the same as so many days or minutes.
 
How can I force the grid to only draw lines at the places where there's actually a label defined?
0 Kudos
Message 1 of 3
(2,878 Views)

Do you have the graph control set to Auto Divisions on the X axis? If so then try setting this to OFF and instead set the number of divisions programmatically (ATTR_XDIVISIONS) to the same number as the quantity of your labels.

JR

Message Edited by jr_2005 on 08-01-2005 05:06 PM

0 Kudos
Message 2 of 3
(2,870 Views)
The problem is, that the user can zoom in on any part of the plot (see the attached image). Since I would like the labels to be for example 10:15, 10:30, 10:45 and not 10:23, 10:31, 10:39, this would mean that the labels are not equally spaced on the X axis, at the start point or end point.
 
In auto mode CVI does exactly the same, their first and last label are not the same width as the rest of the labels in between. But when you set the number of grid lines manually, the spacing is equal for every grid line, including the first and the last. As shown in the attached image, this is not an option.
 
Thus the question remains: is there a way to force the grid to only draw lines at places where the labels actually are defined? I've now just disabled the grid, but it would nice to have it back.
0 Kudos
Message 3 of 3
(2,858 Views)