Jump to content

MultiAxis Chart


anitasri

Recommended Posts

Hello,

I'm trying to generate a multiaxis chart from iReport (version 4.0.0). One chart is a line chart and other one is bar. Both line and bar charts are plotting correctly, but the value(Y) axis for both charts are showing up at left side. I need to show bar chart value axis on left and line chart value axis on left side(one value axis each side.). I'm not able to find any property which I can set for this scenario.

I'll appreciate any help!!!

Thanks,

Anita



Post Edited by anitasri at 06/30/2011 20:26
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Ok, found the answer myself again.  Needed to set the position=rightOrBottom in axis, but it has to be set from xml. So the jxml will be:      

<axis position="rightOrBottom">
      <lineChart>
       <chart>
        <reportElement x="0" y="0" width="0" height="0" isRemoveLineWhenBlank="true" backcolor="#FFFFFF">
         <propertyExpression name="net.sf.jasperreports.chart.range.axis.tick.interval"><![CDATA[$P{line_interval}.toString()]]></propertyExpression>
        </reportElement>
        <chartTitle color="#000000"/>
        <chartSubtitle color="#000000"/>
        <chartLegend textColor="#000000" backgroundColor="#FFFFFF"/>
       </chart>
       <categoryDataset>
        <categorySeries>
         <seriesExpression><![CDATA[$F{noOfAcc_actuals}]]></seriesExpression>
         <categoryExpression><![CDATA[$F{month}]]></categoryExpression>
         <valueExpression><![CDATA[$F{noOfAcc}]]></valueExpression>
        </categorySeries>
        <categorySeries>
         <seriesExpression><![CDATA[$F{noOfAcc_commit}]]></seriesExpression>
         <categoryExpression><![CDATA[$F{month}]]></categoryExpression>
         <valueExpression><![CDATA[$F{noOfAcc}]]></valueExpression>
        </categorySeries>
       </categoryDataset>
       <linePlot>
        <plot/>
        <categoryAxisFormat>
         <axisFormat>
          <labelFont/>
          <tickLabelFont/>
         </axisFormat>
        </categoryAxisFormat>
        <valueAxisFormat>
         <axisFormat>
          <labelFont/>
          <tickLabelFont/>
         </axisFormat>
        </valueAxisFormat>
        <rangeAxisMinValueExpression><![CDATA[$P{line_min}]]></rangeAxisMinValueExpression>
       </linePlot>
      </lineChart>
     </axis>
 

 



Post Edited by anitasri at 07/01/2011 16:22
Link to comment
Share on other sites

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...