LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

right divisions to coincide with automatic left divisions

Is there a way to get the division lines on the right y-axis to coincide with the division lines on the left y-axis when the left axis is set to auto-divisions? I'm trying to put physical units on the left side and ppm units on the right side and I don't want two sets of grid lines. I could use manual divisions on both sides, but I like how auto chooses nice values to divide ({1,2,5}*powers of ten).
0 Kudos
Message 1 of 2
(2,831 Views)
You can obtain the number of divisions on an axis by using

GetCtrlAttribute (panel, control, ATTR_ACTIVE_YAXIS, VAL_LEFT_YAXIS);
GetCtrlAttribute (panel, control, ATTR_ACTUAL_YDIVISIONS, &div);

Next you can set right Y axis with

SetCtrlAttribute (panel, control, ATTR_ACTIVE_YAXIS, VAL_RIGHT_YAXIS);
SetCtrlAttribute (panel, control, ATTR_YDIVISIONS, div);


You will need to accomodate right and left Y axis ranges to obtain a good division value on the right axis. Suppose your left axis has a scale 0 ÷ 100 with 20 divisions and the right axis has a scale 0 ÷ 50, with the same 20 divisions you'll have a quite odd division value of 2.5 units per step on the right axis.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(2,825 Views)