Fixing Curve Colors for Specific Channels in DIAdem

Updated Sep 8, 2025

Reported In

Software

  • DIAdem

Issue Details

By default, DIAdem automatically assigns colors to curves in a 2D graph. However, users may want to assign fixed colors to specific channels to ensure consistency across graphs. 

Solution

You can use a DIAdem VBScript to define specific colors for channels in a 2D curve chart. The following example script shows how to add curves to a 2D display and assign fixed colors: 

 

Dim oMyArea, oMyCurve

'Get the active area of the current sheet
Set oMyArea = View.ActiveSheet.ActiveArea

'Set the display type to 2D curve chart
oMyArea.DisplayObjType = "CurveChart2D"

'Add curve for Time vs. Speed and set color to green
Set oMyCurve = oMyArea.DisplayObj.Curves2D.Add("Time","Speed")
oMyCurve.Color = "green"

'Add curve for Time vs. RPM and set color to blue
Set oMyCurve = oMyArea.DisplayObj.Curves2D.Add("Time","RPM")
oMyCurve.Color = "blue"

'Add curve for Time vs. Torque and set color to red
Set oMyCurve = oMyArea.DisplayObj.Curves2D.Add("Time","Torque")
oMyCurve.Color = "red"
 

 

When you run this script, DIAdem will automatically plot the selected channels (Speed, RPM, and Torque) against Time, and each curve will always appear in the color you assigned.