Pentaho 1.1 and Later Chart Expression XML Examples

Pie Chart

<expression class="org.pentaho.plugin.jfreereport.reportcharts.PieChartExpression" name="PieChart">
<properties>
  <property name="dataSource">chartDataSource</property><!—Set Data Collector -->
  <property name="title">RegionDepartmentChartTitle</property>
  <property name="titleFont">Arial-BOLD-14</property>><!--fontfamilyname-style-pointsize-->
  <property name="labelFont">Arial--8</property>
  <property name="legendFont">Arial--6</property>
  <property name="backgroundColor">#DDDDDD</property>
  <property name="showBorder">true</property>
  <property name="legendLocation">BOTTOM</property>
  <property name="showLegend">true</property>
  <property name="chartWidth">500</property>
  <property name="chartHeight">400</property>
  <property name="useDrawable">false</property>
  <property name="ignoreNulls">true</property>
  <property name="ignoreZeros">true</property>
  <property name="pieLabelFormat">{2}</property>
  <property name="pieLegendLabelFormat">{0}</property>
  <property name="explodeSegment">maxValue</property>
  <property name="explodePct">.20</property>
 </properties>
</expression>

Bar Chart

<expression class="org.pentaho.plugin.jfreereport.reportcharts.BarChartExpression" name="BarChart">
 <properties>
    <property name="dataSource">chartDataSource</property><!—Set Data Collector -->
  <property name="title">Sales By Customer</property>
  <property name="titleFont">Arial-BOLD-9</property><!--fontfamilyname-style-pointsize -->
  <property name="labelFont">Arial--9</property>
  <property name="seriesColor[0]">#018FE1</property><!—HTML Color Code -->
  <property name="seriesColor[1]">#CB02D2</property><!—HTML Color Code -->
  <!-- <property name="seriesColor[n]">#CCCCCC</property><!—HTML Color Code --> -->
  <property name="legendFont">Arial--6</property>
  <property name="backgroundColor">white</property>
  <property name="showBorder">false</property>
  <property name="horizontal">true</property>
  <property name="drawBarOutline">true</property>
  <property name="legendLocation">BOTTOM</property>
  <property name="showLegend">false</property>
  <property name="maxBarWidth">0.10</property>
  <property name="maxCategoryLabelWidthRatio">7.0</property>
  <property name="chartHeight">600</property>
  <property name="chartWidth">480</property>
  <property name="useDrawable">true</property>
  <property name="stacked">false</property>
 </properties>
</expression>

Line Chart

<expression class="org.pentaho.plugin.jfreereport.reportcharts.LineChartExpression" name="LineChart">
  <properties>
    <property name="dataSource">chartDataSource</property><!—Set Data Collector -->
    <property name="title">Actual vs. Budget</property>
    <property name="titleFont">Arial-BOLD-14</property><!--fontfamilyname-style-pointsize -->
    <property name="labelFont">Arial--8</property>
    <property name="legendFont">Arial--6</property>
    <property name="backgroundColor">#DDDDDD</property>
    <property name="showBorder">true</property>
    <property name="horizontal">false</property>
    <property name="seriesColor[0]">#018FE1</property><!—HTML Color Code -->
    <property name="seriesColor[1]">#CB02D2</property><!—HTML Color Code -->
    <!-- <property name="seriesColor[n]">#CCCCCC</property><!—HTML Color Code --> -->
    <property name="legendLocation">BOTTOM</property>
    <property name="showLegend">true</property>
    <property name="chartHeight">300</property>
    <property name="chartWidth">540</property>
    <property name="useDrawable">false</property>
    <property name="labelRotation">7.0</property>
  </properties>
</expression>

Area Chart

<expression class="org.pentaho.plugin.jfreereport.reportcharts.AreaChartExpression" name="AreaChart">
  <properties>
    <property name="dataSource">chartDataSource</property><!—Set Data Collector -->
    <property name="title">Actual vs. Budget</property>
    <property name="titleFont">Arial-BOLD-14</property><!--fontfamilyname-style-pointsize -->
    <property name="labelFont">Arial--8</property><!--fontfamilyname-style-pointsize -->
    <property name="legendFont">Arial--6</property><!--fontfamilyname-style-pointsize -->
    <property name="backgroundColor">#DDDDDD</property>
    <property name="showBorder">true</property>
    <property name="horizontal">false</property>
    <property name="dataSource">chartDataSource</property>
    <property name="seriesColor[0]">#018FE1</property><!—HTML Color Code -->
    <property name="seriesColor[1]">#CB02D2</property><!—HTML Color Code -->
    <!-- <property name="seriesColor[n]">#CCCCCC</property><!—HTML Color Code --> -->
    <property name="legendLocation">BOTTOM</property>
    <property name="showLegend">true</property>
    <property name="chartHeight">300</property>
    <property name="chartWidth">540</property>
    <property name="useDrawable">false</property>
    <property name="labelRotation">7.0</property>
   </properties>
</expression>

Multi Pie Chart

<expression class="org.pentaho.plugin.jfreereport.reportcharts.MultiPieChartExpression" name="MulitPieChart">
  <properties>
    <property name="dataSource">chartDataSource</property><!—Set Data Collector -->
    <property name="title">Actual vs. Budget</property>
    <property name="titleFont">Arial-BOLD-14</property><!--fontfamilyname-style-pointsize -->
    <property name="labelFont">Arial--8</property><!--fontfamilyname-style-pointsize -->
    <property name="legendFont">Arial--6</property><!--fontfamilyname-style-pointsize -->
    <property name="backgroundColor">#DDDDDD</property>
    <property name="showBorder">true</property>
    <property name="seriesColor[0]">#018FE1</property><!—HTML Color Code -->
    <property name="seriesColor[1]">#CB02D2</property><!—HTML Color Code -->
    <!-- <property name="seriesColor[n]">#CCCCCC</property><!—HTML Color Code --> -->
    <property name="legendLocation">BOTTOM</property>
    <property name="showLegend">true</property>
    <property name="chartHeight">300</property>
    <property name="chartWidth">540</property>
    <property name="useDrawable">false</property>
    <property name="multipieByRow">false</property>
    <property name="multipieLabelFormat">{2}</property>
  </properties>
</expression>