02-09-2017 09:58 AM
Hi,
How can I format the time axis in a report plot ? I have tried using the variable D2AxisXFormat without much success. This script gives a plot like this; -
Call PicLoad("Template")
Call GraphObjNew("2D-Axis","2DAxis1")
Call GraphObjOpen("2DAxis1")
Call GraphObjNew("2D-Curve","New_Curve") 'Creates a new curve
Call GraphObjOpen("New_Curve") 'Opens the curve object
D2CChnXName = "TimeCorr"
D2CChnYName = "Current[mA]"
Call GraphObjClose("New_Curve")
Call GraphObjClose("2DAxis1")
Call PicUpdate
which has a nice x axis format by default.
However, if I try to modify the axis (by script), I lose the formating and end up with something like this: -
where the axis info is less useful. The above plot was created by this script which modifies the start and end dates of the previous plot: -
(I also attempt to format the axis...)
Call GraphObjOpen("2DAxis1")
Call GraphObjOpen(D2AxisXObj(1)) 'Setup of X axis
D2AxisXDivMode = "Date/Time"
D2AxisXFormat = "#ttt/yy"
D2AxisXScaleType = "begin/end manual"
D2AxisXBegin = cdate(mid((RTT(View.Sheets("Home").Areas(1).DisplayObj.XBegin)),2,19))
D2AxisXEnd = cdate(mid((RTT(View.Sheets("Home").Areas(1).DisplayObj.XEnd)),2,19))
Call GraphObjClose(D2AxisXObj(1))
Call GraphObjClose("2DAxis1")
call PicUpdate
The start and end are modified, but I cannot reproduce the axis format of the first picture above where the days, months and year are nicely displayed...
I would be grateful for any help on how to proceed?
Thanks!
Solved! Go to Solution.
02-09-2017 03:20 PM
Hello mrme,
Please try this:
D2AxisXFormat = "#dd CRLF ttt/yy"
instead of this:
D2AxisXFormat = "#ttt/yy"
02-10-2017 02:20 AM
Hello Otmar,
It works. Thanks!
Thomas