03-13-2013 06:11 AM
I’m having trouble limiting the number of decimal places in my X Axis on a 2 Axis plot.
I am running a script file (SUD) that sets all the other parameters in the Plot. The “Report “ file is called up and then the script controls the functions.
This is only a small section of the code. I haven’t found a command to set the Decimal place in the “help” page.
ie: Call GraphObjOpen("2DAxis1_XAxis1")
D2AxisXFormat = " "
D2AxisXAng = 0
D2AxisXRelPos = "bottom"
D2AxisXFont = ""
D2AxisXSize = 2
D2AxisXColor = "blue"
D2AxisXColorRGB = 50266112
D2AxisXAutoColor = 0
D2AxisXBold = 0
D2AxisXItal = 0
D2AxisXUndl = 0
D2AxisXStrOut = 0
D2AxisXFrame = 0
Call GraphObjClose("2DAxis1_XAxis1")
And:
When I open the “Curve and Axis Definition” window of the graph on the report page ,and set the “Format:” function to display “d.dd” It seems the script is overwriting the format that I set.
This is what I have now and would like to display only 2 decimal places in the X Axis. Can you help?
Thanks!
SJD
Solved! Go to Solution.
03-13-2013 12:11 PM
Hi Spiderman,
You were really close, you just need to change the value passed in the following variable-- you were indeed overwriting the format value with the script:
D2AxisXFormat = "d.dd"
Brad Turpin
DIAdem Product Support Engineer
National Instruments
03-13-2013 02:15 PM
Thanks Brad for you quick response.
It kind of worked... I think I might have something else going on. Not sure what though.
With the changes made in the script you suggested, the X-Axis has changed to two digits but now it displays " 1.dd "
Any thoughts where else I might have gone wrong?
Thanks again
SJD
03-14-2013 02:07 PM
Hey Spiderman,
I see in your first post you had mentioned that you had specified a format in the graph properties window, and then Brad had suggested adding the line in the script. Although the script line should overwrite the value in the graph parameter screen, I would suggest removing the setting from that window, just to make sure the script is the only place we specify the format.
If that doesn't resolve the issue, could you show us where you placed the D2AxisXFormat line in the script?
03-15-2013 12:54 PM
Hi Spiderman,
You would get that on the X axis if you set the format string to "1.dd". What happens if you run just the script I posted?
Brad Turpin
DIAdem Product Support Engineer
National Instruments
03-26-2013 07:06 AM
Thanks everyone for your help....