Jump to content
Changes to the Jaspersoft community edition download ×

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


RoshanaSheri

Recommended Posts

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

download_0.png.2e652677c3115995d8839db5b43068d1.png

download_1_0.png.3acf553c12c4be23655cef8bc7f4ebe7.png

<?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>[/code]

Any guidance is highly appreciated

SO question 

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Posted Images

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...