07-24-2009 07:50 AM
I have two channels and I want to create a report with 2D axis system. I do not want to drag and drop those two channels into 2D axis system. Can any1 provide me the script by which I can automate the script in such a manner that while running the script only I will get label of X-axis and Y-axis.
I tried with enabling the script but it was not able to generate X-axis label (Ex.-Time) and Y-axis label (Ex. - Speed)?
Solved! Go to Solution.
07-26-2009 11:45 AM
Hi Etn,
The best way to create a script which manipulates an existing layout via script is using the Ctrl-A function within the parameterization dialogs.
The following example creates a 2D axis system with one curve and sets the axis labelling explicitly:
Call PicLoad("Template") 'New layout
Call GraphObjNew("2D-Axis","New_2DAxis1") 'Creates a new 2D axis system
Call GraphObjOpen("New_2DAxis1") 'Opens the axis object
D2AxisBackColor ="grey" 'Sets the background color
D2AxisTop =10 'Sets the position
D2AxisBottom =10
D2AxisLeft =10
D2AxisRight =10
Call GraphObjNew("2D-Curve","New_Curve") 'Creates a new curve
Call GraphObjOpen("New_Curve") 'Opens the curve object
D2CChnXName =ChnNameExt(1) 'Defines the x-channel
D2CChnYName =ChnNameExt(2) 'Defines the y-channel
D2CurveColor ="red" 'Defines the curve color
Call GraphObjClose("New_Curve") 'Closes the curve object
Call GraphObjOpen("2DXAxis1_1")
D2AxisXTxt = "@@ChnName(CurrChnNo)@@ [@@ChnDim(CurrChnNo)@@] (My Speed)" ' Defines the x-label
Call GraphObjClose("2DXAxis1_1")
Call GraphObjOpen("2DYAxis1_1")
D2AxisYTxt = "@@ChnName(CurrChnNo)@@ [@@ChnDim(CurrChnNo)@@] (My Time)" ' Defines the y-label
Call GraphObjClose("2DYAxis1_1")
Call GraphObjClose("New_2DAxis1") 'Closes the axis object
Call PicUpdate() 'Updates the report
Christian
07-26-2009 11:42 PM
Thanx Christian, Its Working...