我想创建一个3D条形图,按类型分组,并显示每种类型的平方英尺值之和。但无法让条形图按颜色显示每种类型的平方英尺值之和。相反,当同一类型和颜色有多个平方英尺值时,似乎只显示最后一个平方英尺值的值。
<?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 IN (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[SUM($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>
Java
标签而导致混淆的原因。明白了。 - iamrajshah