[Meter Chart] Change Font & Color Properties

This recipe demonstrates how to change the font and color properties of Meter Chart.

Major steps include the following:

  1. Create a blank report template (HowToChangeFontandColorProperties.rml) using the datasource (FruitSales.ds).
  2. Add a Meter Full Circle chart in the blank area under “Section Header”.
  3. Enter the following script in the “Script” tab page://Font for the Tick Value
    plot.setTickLabelFont(new java.awt.Font(“SansSerif”,0,14));//Font for the Meter Chart
    plot.setValueFont(new java.awt.Font(“SansSerif”,0,20));//Tick Label color
    plot.setTickLabelPaint(java.awt.Color.yellow);//Inner Circumference color
    plot.setDialOutlinePaint(java.awt.Color.red);//plot.setDrawBorder(false);//Label visible(Default is true, not neccessary to put if true)
    plot.setTickLabelsVisible(true);//Tick color
    plot.setTickPaint(java.awt.Color.green);//Background Color(Can also set in Meter Property)
    plot.setDialBackgroundPaint(java.awt.Color.yellow);//Needle Color
    plot.setNeedlePaint(java.awt.Color.GREEN);

MeterChart-ChangeFont&ColorProperties

To download the necessary files for this recipe, refer to the attached ZIP package.
ChangeFont&ColorProperties.zip (3.7 KB)