How to Change Color of Axis Line of DIAdem Report?

Updated Mar 22, 2023

Reported In

Software

  • DIAdem

Issue Details

  • How can I change the color of axis lines for DIAdem Report programmatically?
  • When I create a report with SystemLink, some color of axis lines are not the same with DIAdem report.

Solution

To control the color of axis lines on DIAdem Report, you need to execute following script.
 
Option Explicit

Dim oMy2DAxisSystem, oMyPosition, oMy2DCurve, oMyXAxisLine, oMyYAxisLine
Call Report.NewLayout()
Set oMy2DAxisSystem = Report.ActiveSheet.Objects.Add(eReportObject2DAxisSystem, "My2DAxisSystem")
Set oMyPosition = oMy2DAxisSystem.Position.ByCoordinate
oMyPosition.X1 = 20
oMyPosition.X2 = 80
oMyPosition.Y1 = 20
oMyPosition.Y2 = 80
Set oMy2DCurve = oMy2DaxisSystem.Curves2D.Add(e2DShapeLine, "MyNew2DCurve1")
oMy2DCurve.Shape.XChannel.Reference = "[1]/[1]"
oMy2DCurve.Shape.YChannel.Reference = "[1]/[2]"
Call oMy2DCurve.Shape.Settings.Line.Color.SetPredefinedColor(eColorIndexblack)
oMy2DAxisSystem.Settings.UseIndividualAxisStyle = True

Set oMyXAxisLine = oMy2DAxisSystem.XAxis.Line
oMyXAxisLine.UseCurveColor = False
Call oMyXAxisLine.Color.SetPredefinedColor(eColorIndexBlue)

Set oMyYAxisLine = oMy2DAxisSystem.YAxis.Line
oMyYAxisLine.UseCurveColor = False
Call oMyYAxisLine.Color.SetPredefinedColor(eColorIndexRed)

Call Report.Refresh()

The VBScript control color of the axis lines and curves as followings.
 
ScriptandColor.png