How to show sum values in jasper report 3d bar charts

0

I'm trying to create a 3d bar chart which groups by type and shows the sum of squarefeet values for each type. But I couldn't get the bars to show the sum of squarefeets for each types per color. Instead it seems to show the value of last squarefeet when there are more than one squarefeet value for same type and color

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0  -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="barChart" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="4f80af00-8345-4feb-bd0c-5b0b3b2b6232">
    <property name="com.jaspersoft.studio.data.sql.tables" value=""/>
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="hsqlCon"/>
    <queryString language="SQL">
        <![CDATA[select * from Item where id = ANY ( select itemId from TempItem)]]>
    </queryString>
    <field name="COLOR" class="java.lang.String">
        <property name="com.jaspersoft.studio.field.label" value="COLOR"/>
        <property name="com.jaspersoft.studio.field.tree.path" value="ITEM"/>
    </field>
    <field name="SQUAREFEET" class="java.lang.Double">
        <property name="com.jaspersoft.studio.field.label" value="SQUAREFEET"/>
        <property name="com.jaspersoft.studio.field.tree.path" value="ITEM"/>
    </field>
    <field name="TYPE" class="java.lang.String">
        <property name="com.jaspersoft.studio.field.label" value="TYPE"/>
        <property name="com.jaspersoft.studio.field.tree.path" value="ITEM"/>
    </field>
    <group name="TYPE">
        <groupExpression><![CDATA[$F{TYPE}]]></groupExpression>
    </group>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
        <band height="35" splitType="Stretch"/>
    </pageHeader>
    <detail>
        <band height="257" splitType="Stretch">
            <bar3DChart>
                <chart evaluationTime="Report">
                    <reportElement x="139" y="0" width="581" height="257" uuid="f2ceb018-5078-4aeb-90df-125419604d39"/>
                    <chartTitle/>
                    <chartSubtitle/>
                    <chartLegend/>
                </chart>
                <categoryDataset>
                    <categorySeries>
                        <seriesExpression><![CDATA[$F{COLOR}]]></seriesExpression>
                        <categoryExpression><![CDATA[$F{TYPE}]]></categoryExpression>
                        <valueExpression><![CDATA[$F{SQUAREFEET}]]></valueExpression>
                    </categorySeries>
                </categoryDataset>
                <bar3DPlot>
                    <plot/>
                    <itemLabel/>
                    <categoryAxisFormat>
                        <axisFormat labelColor="#000000" tickLabelColor="#000000" axisLineColor="#000000"/>
                    </categoryAxisFormat>
                    <valueAxisFormat>
                        <axisFormat labelColor="#000000" tickLabelColor="#000000" axisLineColor="#000000"/>
                    </valueAxisFormat>
                </bar3DPlot>
            </bar3DChart>
        </band>
    </detail>
    <pageFooter>
        <band height="54" splitType="Stretch"/>
    </pageFooter>
</jasperReport>

Any guidance is highly appreciated

SO question

RoshanaSheri's picture
Joined: Jan 2 2019 - 1:18am
Last seen: 11 months 1 week ago

0 Answers:

No answers yet
Feedback
randomness