Jump to content
Changes to the Jaspersoft community edition download ×

PIE charts from XML Datasource Help??


2005 IR Help

Recommended Posts

By: sri - sriniv007

PIE charts from XML Datasource Help??

2005-04-11 00:21

i need to generate a PIE chart from xml file using XML DATASOURCE, i need a pie chart for the A,B,C values .

i am using ireport 1.4.1 & jasper 0.6.5

My file is as follows :

<?xml version="1.0" ?>

<segments>

<segment>

<code>1000</code>

<segmentname>wer</segmentname>

<value>100</value>

<description>A</description>

<A>200</A>

<B>400</B>

<C>600</C>

</segment>

</segments>

 

Please forward your toughts on this..

S

 

 

 

 

 

By: Franck Andriano - altern

RE: PIE charts from XML Datasource Help??

2005-04-15 08:24

First see : it.businesslogic.ireport.examples.XMLDataSourceExample

 

Second see :

init each series (Label & Data) step by step in different element group that will never printed out :

 

<group name="init_label1" isStartNewColumn="false" isStartNewPage="false" isResetPageNumber="false" isReprintHeaderOnEachPage="false" minHeightToStartNewPage="0" >

<groupExpression><![CDATA[null]]></groupExpression>

<groupHeader>

<band height="0" isSplitAllowed="true" >

</band>

</groupHeader>

<groupFooter>

<band height="20" isSplitAllowed="true" >

<printWhenExpression><![CDATA[new Boolean

(

((it.businesslogic.ireport.IReportScriptlet) $P{REPORT_SCRIPTLET}).addValueToSerie("SERIE_LABEL", "500 - 1000").booleanValue()

)]]></printWhenExpression>

</band>

</groupFooter>

</group>

 

<group name="init_data1" isStartNewColumn="false" isStartNewPage="false" isResetPageNumber="false" isReprintHeaderOnEachPage="false" minHeightToStartNewPage="0" >

<groupExpression><![CDATA[null]]></groupExpression>

<groupHeader>

<band height="0" isSplitAllowed="true" >

</band>

</groupHeader>

<groupFooter>

<band height="20" isSplitAllowed="true" >

<printWhenExpression><![CDATA[new Boolean

(

((it.businesslogic.ireport.IReportScriptlet) $P{REPORT_SCRIPTLET}).addValueToSerie("SERIE_DATA", new Integer( ($V{nb_eco_ttot500}.intValue() * 100 / $V{nb_eco_ttot}.intValue())) ).booleanValue()

)]]></printWhenExpression>

</band>

</groupFooter>

</group>

 

[etc...]

 

end see :

<imageExpression class="java.awt.Image"><![CDATA[(java.awt.Image)it.businesslogic.ireport.chart.DefaultChartFactory.drawChart(new String[]{"antialias=true","tooltips=true","legend=true","chartName=Bar3D","plotOrientation=2","foregroundAlpha=0.33","valueLabel=Nombre d'飯le","subtitle=","plotBackground=[255,255,255]","quality=2","height=295","titlePosition=1","chartBackground=[255,255,255]","width=674","serie2=SERIE_LABEL","serie1=SERIE_DATA2","serie0=SERIE_DATA2","categoryLabel=Tranche","title=Nombre d'飯le / CM-CS"}, (it.businesslogic.ireport.IReportScriptlet)$P{REPORT_SCRIPTLET})]]></imageExpression> </image>

 

don't forgot :

 

<jasperReport ... scriptletClass="com....reporting.tableau_7Scriptlet">

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

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