Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I change the caption's font for the CWGraph XY plot axes at runtime?

 
0 Kudos
Message 1 of 6
(7,838 Views)

Hi DrWisch,

If you had a CWGraph XY plot named CWGraph1, you could simply say

CWGraph1.Caption = "New Caption"

This would allow you to change the caption at any point during runtime.

Hope this helps!

Jonathan N.
National Instruments
0 Kudos
Message 2 of 6
(7,827 Views)
Sorry, for not being more clear, but I would like to change the caption of the X-axis and all Y-axes at runtime.  On the CWGraph property pages, the axes' fonts can be changed on the Advanced tab, under Parts.
0 Kudos
Message 3 of 6
(7,820 Views)

Hi DrWisch,

Finding these methods and properties for the graphs just take a matter of looking through the help. Refer below for example code for setting axis captions.

X-Axis: cwgraph1.Axes(1).Caption =  "X axis caption"

Y-Axis: cwgraph1.Axes(2).Caption = "Y axis caption"

Hope this helps!

Jonathan N.
National Instruments
0 Kudos
Message 4 of 6
(7,815 Views)
In your example code, how can I change the font size of "X axis caption" and "Y axis caption" at runtime?
0 Kudos
Message 5 of 6
(7,802 Views)

Hi DrWish,

Currently there is no option to access the font size of those individual axes like you can under the Advanced tab. Refer to this post for more information.

You can however set the font size and type for the entire CWGraph by saying

CWGraph1.Font.Name = "Arial"
CWGraph1.Font.Size = 15

If you would like to have this feature exposed in the near future of Measurement Studio, you can submit your suggestions at www.ni.com >> Contact NI >> Product Feedback.

Hope this helps!

Jonathan N.
National Instruments
0 Kudos
Message 6 of 6
(7,792 Views)