DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

report 2D-Curve choice of axis

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

 

0 Kudos
Message 1 of 5
(4,969 Views)

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()

0 Kudos
Message 2 of 5
(4,948 Views)

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()

0 Kudos
Message 3 of 5
(4,948 Views)

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

 

0 Kudos
Message 4 of 5
(4,808 Views)

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

0 Kudos
Message 5 of 5
(4,804 Views)