Video: Report Designer - Colouring Points In Charts Using Scripts

Video: Report Designer - Colouring Points In Charts Using Scripts

This video demonstrates how to use Scripts within the Report Designer to colour data points in Charts based on the value of the data point. The script used within this demonstration is provided below the video.



 Demonstration Script

To insert the below script into the chart control for your report, perform the following steps:

  1. With your report open in the Report Designer, click on Scripts in the the Report Ribbon.
  2. Select your chart from the Control drop-down list (by default, the first chart created is named chart1).
  3. Select Custom Draw a Series Point as the Event type, the Event is created in the script window.
  4. Copy and paste the below script into the Script window.
  5. Click on the Validate button in the Script window to check and verify the script.
  6. Click on the Preview button in the Report Ribbon to review the report, showing the points highlighted.

 

double currentValue = e.SeriesPoint.Values[0];

if( currentValue < 9)

{

PointDrawOptions line = e.SeriesDrawOptions as PointDrawOptions ;

line.Color = System.Drawing.Color.Green;

}

else

{

Point.DrawOptions line = e.SeriesDrawOptions as PointDrawOptions ;

line.Color = System.Drawing.Color.Orange;

}