From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Add minor grid on the Y-Axis or X-Axis of a graph control

Hello,

In LabVIEW , there are 9 style of scales to indentify the axis of a graph , one of which can mark the minor grid line , but why can not find such a style scale in CVI ? Can make such a scale in CVI ? By the way , can adjust the graph window on the graph pan ? I means that just like LabVIEW , the graph window can be zoomed by the mouse in the graph pan .
0 Kudos
Message 1 of 11
(4,209 Views)
Hi davidLee,

When you place a graph control and double click on it, you will see different properties that you can change on a graph. One of them is a Grid Color option. Also when you click on Bottom/Top X-axis or Left/Right Y-axis, you can select Grid and Minor Grid Lines to show or to hide.

You can perform these operations programmatically as well using SetCtrlAttribute function for your graph control. On the function panel for SetCtrlAttribute, click on Control Attribute and select Graph for Control type. Then the attributes you would use are Grid Color, X Grid Visible, X Minor Grid Visible, etc.

Regarding zooming the graphs, there is a shipping example that comes with CVI called graphcursors (located at C:\Program Files\National Instruments\CVI71\samples\userint) and it illustrates how to zoom, etc.

Hope this helps and good luck with your application!

Shakhina P.
Applications Engineer
NI
0 Kudos
Message 2 of 11
(4,192 Views)
Hi Shakhina,

What I said means that want to make full tick marks correspond to the minor grid line .I do not find any way . For adjust the graph control , I means that just want to zoom in/out the graph window , but not the full graph control , just like LabVIEW , to the graph control , not only zoom the full control , but also can adjust the size of the graph window individually . Please give an advise. Thanks.

David
0 Kudos
Message 3 of 11
(4,184 Views)
Hi David,

To show the tick marks for the minor grid lines use the property ATTR_INNER_MARKERS_VISIBLE in SetCtrlAttribute(). But make sure to specify a small enough font size for 'Axis Labels' in graph properties (i.e. 'Edit Graph' window), otherwise the tick marks won't show up in your graph.

I am not quite sure what kind of zooming you would like to implement exactly, but have you tried the built-in zooming feature of the graphs? For that you would need to 'Enable Zooming' by selecting the checkbox and set the 'Control Mode' to either 'Normal' or 'Hot'. Then you can zoom in and out of the graph using Ctrl + left/right mouse buttons and you can pan by holding down Ctrl+Shift+left click and dragging the mouse. This is also explained in the CVI help (Help -> Contents -> Graph Control Overview -> Operating Graph Controls). If you need to zoom a specific portion of the graph then you can use the shipping example I mentioned in the last reply.

Hope this help and good luck!
Shakhina P.
NI
0 Kudos
Message 4 of 11
(4,169 Views)
Shahina,

I have noted the help doc. what you point. but can not do anything as the help's spec . I think what I said should be called "view port" , and just want to adjust its size , not the full size of the graph . As the help spec.,"To zoom out, click on the right mouse button, and then press the key as you do to zoom in", it just will popup a menu , cannot do what I want to do . By the way, I am using CVI 7.1. The attachment is a diagram of "view port" want to resize . Please give a detail spec , Thanks.


David
0 Kudos
Message 5 of 11
(4,158 Views)
Shahina,

I have noted the help doc. what you point. but can not do anything as the help's spec . I think what I said should be called "view port" , and just want to adjust its size , not the full size of the graph . As the help spec.,"To zoom out, click on the right mouse button, and then press the key as you do to zoom in", it just will popup a menu , cannot do what I want to do . By the way, I am using CVI 7.1. The attachment is a diagram of "view port" want to resize . Please give a detail spec , Thanks.


David
0 Kudos
Message 6 of 11
(4,159 Views)
David,

I'm not sure if this what you are looking for or not...

1. Edit the graph in the UI editor and turn on "Enable Zooming"
2. Make sure that the Control Mode of the graph is not set to "Indicator".
3. Then hold down the key and click somewhere in the plot area of the graph. You should start to see the plot area being zoomed.

If this is not what you are looking for, please be more specific in describing what you mean.

Luis
NI
0 Kudos
Message 7 of 11
(4,150 Views)
Luis,

Yes , I understand the operate steps. But It seems that must enable the "Operate tool" on the UIR editor , then performing the zoom function , is this right? By the way , I just want to resize the graph window , not the full size of the control , like LabVIEW , because in LV, I can resize the graph control , but also can resize the graph view port ,I hope I can also do that in LW. Please give an advise. Thanks.


David
0 Kudos
Message 8 of 11
(4,141 Views)
You cannot change the size of the graphing area independent of the size of the control. You can hide the border area of the control (so only the graph view port is visible) by going to the properties and unchecking the "Show Border Area" checkbox. Or you can hide the individual axes and that will change the graph viewing area as well.

If you can tell me what you are trying to do, perhaps I could recommend something better. Hope this helps.
Bilal Durrani
NI
0 Kudos
Message 9 of 11
(4,135 Views)
Bial,

I just want to place some widgets on the graph's frame ,such as legend, measure units identifier, buttons etc.,so that make the full panel seeing more compact.

David
0 Kudos
Message 10 of 11
(4,122 Views)