Jump to content
We've recently updated our Privacy Statement, available here ×

cutshaw

Members
  • Posts

    6
  • Joined

  • Last visited

cutshaw's Achievements

Rookie

Rookie (2/14)

  • First Post Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. I've tried it on both the detail and summary sections and I get the same behavior. I've also created the pie chart with Java code and passed in the JFreeChartRenderer object as a parameter and that works fine. I was just trying to see if I could do it all in the XML without the Java code.
  2. I'm having a problem with creating a pie chart. Here are the relevant lines in the XML file: Code:<field name="key" class="java.lang.String"/> <field name="keyVal" class="java.lang.Integer"/> <pie3DChart> <chart> <reportElement x='250' y='0' width="300" height="200" mode="Opaque"/> </chart> <pieDataset> <keyExpression><![CDATA[$F{key}]]></keyExpression> <valueExpression><![CDATA[$F{keyVal}]]></valueExpression> </pieDataset> <pie3DPlot> <plot backcolor="white"/> </pie3DPlot> </pie3DChart> I create the data source for the report in the Java code like this: Code:[code] HashMap ds[] = new HashMap[3]; for (int i=0; i < ds.length; i++) { ds = new HashMap(); ds.put("key", "Key " + (i + 1)); } ds[0].put("keyVal", new Integer(10)); ds[1].put("keyVal", new Integer(30)); ds[2].put("keyVal", new Integer(60)); JRDataSource dataSource = new JRMapArrayDataSource(ds); The pie chart looks good, but there are three of them instead of just one. It creates the same number of pie charts as the length of the HashMap array. What am I doing wrong?
×
×
  • Create New...