0
我正在使用Jaspersoft Studio 5.6,嘗試創建基於分組參數顯示多個XY(或條形圖)的報表。我已經把我的原始數據弄糟了,但我仍然無法弄清楚。創建分組的條形圖或折線圖
DATA
+------+------+-------+
| xrow | yrow | group |
+------+------+-------+
| 1 | 11 | 1 |
| 2 | 12 | 1 |
| 3 | 10 | 1 |
| 1 | 5 | 2 |
| 2 | 10 | 2 |
| 3 | 14 | 2 |
+------+------+-------+
這裏是我的XML代碼:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version last-->
<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="group3" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="cdd6d2cf-7c0c-4d79-8cfe-a4f1e04da233">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Office"/>
<queryString language="SQL">
<![CDATA[SELECT maintenance.test.xrow,
maintenance.test.yrow,
maintenance.test.group
FROM maintenance.test]]>
</queryString>
<field name="xrow" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="yrow" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="group" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<sortField name="group"/>
<sortField name="xrow"/>
<group name="Group1">
<groupExpression><![CDATA[$F{group}]]></groupExpression>
<groupHeader>
<band height="190">
<barChart>
<chart evaluationTime="Report">
<reportElement x="40" y="0" width="460" height="190" uuid="582be7ed-4b48-4d55-a2b6-1295290d34e3"/>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<categoryDataset>
<dataset resetType="Group" resetGroup="Group1"/>
<categorySeries>
<seriesExpression><![CDATA["SERIES 1"]]></seriesExpression>
<categoryExpression><![CDATA[$F{xrow}]]></categoryExpression>
<valueExpression><![CDATA[$F{yrow}]]></valueExpression>
</categorySeries>
</categoryDataset>
<barPlot>
<plot/>
<itemLabel/>
<categoryAxisFormat>
<axisFormat/>
</categoryAxisFormat>
<valueAxisFormat>
<axisFormat/>
</valueAxisFormat>
</barPlot>
</barChart>
</band>
</groupHeader>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch"/>
</title>
<pageHeader>
<band height="35" splitType="Stretch"/>
</pageHeader>
</jasperReport>
我創建了一個報告組列「組」
我把圖表中的組頁眉區域。並且我嘗試將「重置」設置爲GROUP以及REPORT(在圖表嚮導中),結果沒有變化。見下面的屏幕截圖。
我不知道下一步該做什麼。