DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create Coloured bar scale

 

Hi,

 

I am working on Diadem12 and I want to create a colour graded bar scale showing the current performance of my test result in percentage of the allowable limit.

 

Detail : Consider I have a variable calculated in Diadem which corresponds to perfomance of my test and I have upper limit for this value. I want to show the calculated value for my test as a percentage of the limit and if the percentage is

  • less than 80%, then it should be filled  with green
  • between 80 to 100% then it should be filled with orange and
  • more than 100%  then it should be filled with red.

(pls see attached snapshot)

 

For example: Lets say the upper limit for max acceleration measured is 150 and the x be the measured value in my test (in percentage of the upper limit). Now if x is less than 80 then bar should be filled with green, between 80 to 100 to be filled with orange and more than 100 to be filled with red.

 

Please let me know possible ways to do this.

 

Regards,

Fazil Shah.

0 Kudos
Message 1 of 2
(5,086 Views)

 

I was able to do this by creating a 2D axis in the report (which can be include in the template file) and then creating rectangular frame with fill and then positioning it same as the 2D axis by the following code.

 

Dim oMyFrame, oMyBackgroundColor, oMyPosition, oMyBorderLine, oMyShadow
Set oMyFrame = Report.ActiveSheet.Objects.Add(eReportObjectFrame,"MyFrame")
Set oMyBackgroundColor = oMyFrame.BackgroundColor
Call oMyBackgroundColor.SetPredefinedColor('colour variable depending on value))
Set oMyPosition = oMyFrame.Position.ByCoordinate
oMyPosition.X1 = 60 -----------------------------------------------------(X1 position of 2D Axis)
oMyPosition.X2 = 70 -----------------------------------------------------(X2 position of 2D Axis)

oMyPosition.Y1 = 60 -----------------------------------------------------(Y1 position of 2D Axis)

oMyPosition.Y2 = ValMin(Y1+(% value ),80) ----------------------(80 is Y2 for 2D axis)

Now a problem I am facing is that, this works only in Diadem 12, can any1 help me in modifying this so that this works in Diaden 11 also?

0 Kudos
Message 2 of 2
(4,943 Views)