Pie Chart
This section provides more information on pie chart attributes and XML.
Tip:
The Reporting and
Analytics report builder cannot show negative values in a pie chart.
Use the advanced editor to convert negative values to positive values
to show the values in the pie chart. Convert negative values by adding * -1 to the column name. The following example shows how
to convert a negative discount amount to a positive amount:
Before: sum_discAmt
After: sum_discAmt
* -1
| Attribute Name | XML declaration | Description / Notes |
|---|---|---|
|
name |
|
|
|
items |
|
This attribute must directly follow the |
|
hoverSeriesLabel |
|
|
|
hoverValueLabel |
|
|
|
extraItem |
|
These are extra chart data points/items values. The value is derived based on the cell type definition. |
|
hoverExtraItemLabel |
|
|
|
dataTypeExtraItemFormat |
|
|
Example of XML Report Definition to Generate Pie Chart JSON Data
<report>
<frame type="table" query-name="MajorGroupsQuery" name="barFrame">
<bands>
<band type="table-body">
<cell type="column" data-format="text" alignment="left" print-width="140" chart-attr-name="seriesName">majorGroupNameMaster</cell>
<cell type="column" data-format="currency" alignment="right" suppress-formatting="true" print-width="70">salesTotal</cell>
<cell type="column" data-format="integer" alignment="left" print-width="140" chart-attr-name="extraItem">salesTotal</cell>
<!-- extra cell to match count in table-column -->
<cell type="chart_text" data-format="text" alignment="left"></cell>
</band>
<band type="table-column-header">
<!-- hover series label attribute -->
<cell type="text" data-format="text" alignment="left" chart-attr-name="hoverSeriesLabel">Test Series</cell>
<!-- hover value label attribute -->
<cell type="text" data-format="text" alignment="left" chart-attr-name="hoverValueLabel">Test Value</cell>
<!-- hover extraItem label attribute -->
<cell type="text" data-format="text" alignment="left" chart-attr-name="hoverExtraItemLabel">Test ExtraItem</cell>
<!-- dataTypeExtraItemFormat attribute -->
<cell type="chart_text" data-format="text" alignment="left" chart-attr-name="dataTypeExtraItemFormat">percent</cell>
</band>
</bands>
</frame>
<layout type="columner">
<component frame-name="barFrame" column="1" visual-type="ojPie" visual-style="oj-sm-12" visual-title="TotalOperatingCosts"/>
</layout>
</report>Parent topic: Visualizations