Use the PieChart tag to generate and include a pie chart in a report. 


Example XML

<Report>
  <ItemTemplate type="RQ">
    <Choose>
      <When test="@PRIO = 1">
        <AddToSlice name="1"/>
      </When>
      <When test="@PRIO = 2">
        <AddToSlice name="2"/>
      </When> 
      <When test="@PRIO = 3">
        <AddToSlice name="3"/>
      </When> 
      <Otherwise> 
        <AddToSlice name="unknown"/>
      </Otherwise> 
    </Choose> 
  </ItemTemplate>
  <Text>#{Name}</Text>
  <PieChart>
    <Slices>
      <Slice name="1" caption="Prio 1  " color="blue"/>
      <Slice name="2" caption="Prio 2  " color="red"/>
      <Slice name="3" caption="Prio 3  " color="yellow"/> 
      <Slice name="unknown" caption="Unknown" color="green"/>
    </Slices>
    <Counter>
      <ForEachPart type="XESX">
        <DefObj>
          <ForEachPart type="EXAC">
            <DefObj>
              <ForEachPart type="IBAR">
                <DefObj>
                  <ApplyItemTemplates/>
                </DefObj>
              </ForEachPart>
            </DefObj>
          </ForEachPart> 
        </DefObj>
      </ForEachPart>
    </Counter>
  </PieChart> 
</Report>


Result

The pie chart is generated and included in the report.


Note: For technical reasons, the layout of the diagram differs slightly from the display of pies in the Charts views. For example, the labels of the different slices are printed within each slice instead of at outside edge.