12-19-2014 08:45 AM
Hello,
I'm trying to create a 2D-axis system with 2 y-axis. In respect to the 2 y-axis 2 different channels were choose. But the problem is that the scaling of that 2 channels are different.
I had create a new y-axis object with 'GraphObjYAxisNew', but I did not find the command for choosing the second y-axis in the 2D-Curve.
In the User Interface it is possible to choose the y-axis for the 2D-Curve, but I did not find the agreeing command in the script.
Thank you in advance,
Thomas
12-20-2014 05:27 AM
Hi Thomas
The script below will build a chart object and make two Y axes. Each of the axes have variables that are as assigned to that you have control from script for configuring them.
Paul.
Option Explicit 'Forces the explicit declaration of all the variables in a script.
dim sSheetName_: sSheetName_="Sheet 2"
dim sChartName_:sChartName_ = "chart01"
dim o2DAxisSystem,o2DCurve1,o2DCurve2,o2DAxisY2
Set o2DAxisSystem = Report.Sheets(sSheetName_).Objects.Add(eReportObject2DAxisSystem, sChartName_)
Set o2DCurve1 = o2DAxisSystem.Curves2D.Add(e2DShapeLine,sChartName_&"Curve1")
Set o2DCurve2 = o2DAxisSystem.Curves2D.Add(e2DShapeLine,sChartName_&"Curve2")
Set o2DAxisY2 = o2DAxisSystem.YAxisList.Add(sChartName_&"Curve2_Yxis")
o2DCurve2.YAxisReference = sChartName_&"Curve2_Yxis"
report.Refresh()
12-20-2014 05:27 AM
Hi Thomas
The script below will build a chart object and make two Y axes. Each of the axes have variables that are as assigned to that you have control from script for configuring them.
Paul.
Option Explicit 'Forces the explicit declaration of all the variables in a script.
dim sSheetName_: sSheetName_="Sheet 2"
dim sChartName_:sChartName_ = "chart01"
dim o2DAxisSystem,o2DCurve1,o2DCurve2,o2DAxisY2
Set o2DAxisSystem = Report.Sheets(sSheetName_).Objects.Add(eReportObject2DAxisSystem, sChartName_)
Set o2DCurve1 = o2DAxisSystem.Curves2D.Add(e2DShapeLine,sChartName_&"Curve1")
Set o2DCurve2 = o2DAxisSystem.Curves2D.Add(e2DShapeLine,sChartName_&"Curve2")
Set o2DAxisY2 = o2DAxisSystem.YAxisList.Add(sChartName_&"Curve2_Yxis")
o2DCurve2.YAxisReference = sChartName_&"Curve2_Yxis"
report.Refresh()
01-07-2015 03:00 AM
Hello Paul,
thank you for your fast answer.
I found a similar solution close to my question. To my mind it works in the same way:
' y-Axis
' ----------------------------------------------------------------------------
Call GraphObjOpen(D2AxisYNam(1))
Call GraphObjClose(D2AxisYNam(1))
' 2. y-Axis
' ----------------------------------------------------------------------------
Call GraphObjYAxisNew("right")
Call GraphObjOpen(D2AxisYObj(2))
Call GraphObjClose(D2AxisYObj(2))
In respect to some skills in programming that code is less object-orientated way and is more using the framework of DIAdem.
Kind regards,
Thomas
01-07-2015 03:35 AM
Hello Thomas,
Yes, this is also possible, but please keep in mind that your example is the old syntax which is of course still supported but just on maintenance. Extensions in DIAdem REPORT only supported with the new object oriented API and bay the way, the new ooAPI is much faster. So I would prefer the new ooAPI.
Greetings from Aachen
Walter