How convert Pie3D to HTML5 Pie

Can somebody convert Pie chart to HTML5 one? How can you convert this type of chart if there are more than 1 series in pie?
i.e. I have Pie3D
<chart theme="aegean">
    <reportElement x="583" y="97" width="350" height="180" uuid="57f9d143-e18d-4f2d-a001-e4b09f76da72"/>
    <itemLabel color="#000000" backgroundColor="#FFFFFF"/>
How convert if to HTML5 Pie, if this type of chart has only 1 Mesure?
andrqxa's picture
Joined: Apr 6 2012 - 5:16am
Last seen: 5 years 12 months ago

1 Answer:

There is no direct way of feeding two values per record into a single series in HTML5 charts.  You can contact the Jaspersoft commercial support and file a feature request (or bug if you consider it so).

Depending on your exact use case, there might be some workarounds.

For instance, if you only need to feed two values (that is a single record) into the chart, you can create a subdataset and pass a data source with two records to it.  That is something like:

<subDataset name="ChartDataset">

<field name="key"/>

<field name="value" class="java.lang.Integer"/>





<datasetRun subDataset="ChartDataset">

<dataSourceExpression>new[[key: "a", value: 5], [key: "b", value: 10]])</dataSourceExpression>




<dataAxis axis="Rows">

<axisLevel name="Key">


<axisLevelBucket class="java.lang.String">





<multiAxisMeasure name="Measure" class="java.lang.Integer" calculation="Nothing">





Note that the example uses Groovy expressions for the sake of list and map literals.
If you need to feed several records into a single chart, something similar can be achieved by collecting the value into a list.  That would be more tedious though.
Lucian Chirita
lucianc's picture
Joined: Jul 17 2006 - 1:10am
Last seen: 18 sec ago