I am using now iText 1.3.1 and before it was iText 1.0.1. Here some sample of the scriptlet for the pie chart : Code: public void afterDetailEval() throws JRScriptletException { super.afterDetailEval(); PieDataset dataset = null; try { dataset = (PieDataset) JFreeDataSetFactory.getInstance().getDataSet( JFreeDataSetFactory.DS_BUILDER_ENCOURS_ECHEANCE, this.getReportParameters()); } catch (ExceptionTechnique e) { // TODO Auto-generated catch block throw new JRScriptletException("Impossible de construire le DataSet pour l chart [" + JFreeDataSetFactory.DS_BUILDER_ENCOURS_ECHEANCE + "] Titre" + "[" + EncoursParEcheanceChartReport.REPORT_DEFAULT_TITLE+ "]", e); } JFreeChart chart = ChartFactory.createPieChart3D( EncoursParEcheanceChartReport.REPORT_DEFAULT_TITLE, dataset, true, true, false); //Customization ChartsUtils.configureStandard3DPiePlot((PiePlot3D) chart.getPlot()); ChartsUtils.configureStandardLegend((LegendTitle)chart.getLegend()); this.setVariableValue(EncoursParEcheanceChartReport.VAR_CHART_ENCOURS, new JCommonDrawableRenderer(chart)); } The scriptlet for the timesseries chart : Code:[code] public void afterDetailEval() throws JRScriptletException { String libelleFonds = (String) this.getParameterValue(HistoVLParFondsReport.PRM_FONDS_NAME); String fondsID = (String) this.getParameterValue(HistoVLParFondsReport.PRM_FONDS_ID); if (fondsID != null) { //Edition chart VL sur la période donnée TimeSeriesCollection chartVLSeries = null; Map reportParameters = getReportParameters(); try { chartVLSeries = (TimeSeriesCollection) JFreeDataSetFactory.getInstance().getDataSet( JFreeDataSetFactory.DS_BUILDER_HISTO_VL_PAR_FONDS, reportParameters); } catch (ExceptionTechnique e) { StringBuffer errorSgb = new StringBuffer(); String sep = System.getProperty("line.separator"«»); String indent = "t"; errorSgb.append("HistoVLParFondsScriptlet.beforeReportInit :: "«»).append(sep).append(indent).append( "Erreur en création de la Série histo des VL [" + e.getClass() + "]"«»).append(sep).append(indent) .append("[" + e.getMessage() + "]"«»).append(sep).append(indent).append("FondsID[" + fondsID + "]"«») .append(sep).append(indent).append("FondsNom[" + libelleFonds + "]"«»).append(sep).append(indent).append( "Une série vierge va être utilisée."«»); LOG.error(errorSgb.toString(), e); chartVLSeries = new TimeSeriesCollection(new TimeSeries(fondsID)); } TimeSeries vlSeries = chartVLSeries.getSeries(fondsID); vlSeries.setKey(libelleFonds); //vlSeries.setName(libelleFonds); double pourcent = 0; if (vlSeries.getItemCount() > 0) { pourcent = (vlSeries.getValue(vlSeries.getItemCount() - 1).doubleValue() - vlSeries.getValue(0) .doubleValue()) / Math.max(vlSeries.getValue(0).doubleValue(), 0.001); } JFreeChart chartVLSeriesAnnee = ChartFactory.createTimeSeriesChart( libelleFonds + " - " + (String) reportParameters.get(ReportsPeriodiqueConstants.PRM_PERIODE_LABEL), "", "en u20AC", chartVLSeries, false, false, false); ChartsUtils.configureStandardXYPlot((XYPlot)chartVLSeriesAnnee.getPlot()); ChartsUtils.configureTitle(chartVLSeriesAnnee.getTitle()); this.setVariableValue(HistoVLParFondsReport.VAR_CHART_VL, new JCommonDrawableRenderer(chartVLSeriesAnnee)); this.setVariableValue(HistoVLParFondsReport.VAR_POURCENT_EVOL, new Double(pourcent)); } Source of ChartsUtils : Code:[code] /* * Created on 12 oct. 2004 * */ import java.awt.Color; import java.awt.Font; import java.awt.GradientPaint; import java.text.NumberFormat; import org.jfree.chart.axis.AxisSpace; import org.jfree.chart.labels.PieSectionLabelGenerator; import org.jfree.chart.labels.StandardPieSectionLabelGenerator; import org.jfree.chart.plot.PiePlot3D; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.title.LegendTitle; import org.jfree.chart.title.TextTitle; import org.jfree.ui.RectangleInsets; import org.jfree.util.Rotation; /** * * Type ChartsUtils : * * @author dansou_d * @version 1.0 * */ public final class ChartsUtils { public static final Font FONT_ARIAL_8_PLAIN = new Font("Arial", Font.PLAIN, 8); public static final Font TIMES_NEW_ROMAN_8_PLAIN = new Font("Times new roman", Font.PLAIN, 8); public static final Font TIMES_NEW_ROMAN_5_PLAIN = new Font("Times new roman", Font.PLAIN, 5); public static final String NO_DATA_MSG = "Aucune donnée à éditer"; /** * Constructeur privé : Evite toute instanciation intempestive de cette classe * */ private ChartsUtils() { super(); } public static final PieSectionLabelGenerator getLabelPercentileGenerator() { return new StandardPieSectionLabelGenerator("{0} = {2}", NumberFormat.getNumberInstance(), NumberFormat .getPercentInstance()); } public static final PieSectionLabelGenerator getPercentileGenerator() { return new StandardPieSectionLabelGenerator("{2}", NumberFormat.getNumberInstance(), NumberFormat .getPercentInstance()); } /** * Customization standard : * <ul> * <li>StartAngle = 180° * <li>Direction = Sens aiguille montre * <li>Label = Type pourcentage * <li>NoDataMsg = Aucune donnée à éditer * </ul> * @param plot */ public static final void configureStandard3DPiePlot(PiePlot3D plot) { plot.setStartAngle(180); plot.setDirection(Rotation.CLOCKWISE); plot.setLabelGenerator(getPercentileGenerator()); plot.setInteriorGap(0); plot.setNoDataMessage(NO_DATA_MSG); } /** * @param legend */ public static final void configureStandardLegend(LegendTitle legend) { legend.setItemFont(TIMES_NEW_ROMAN_5_PLAIN); } /** * * @param plot : prm */ public static final void configureStandardXYPlot(XYPlot plot) { // plot.setDataAreaRatio((double)1/3); plot.setBackgroundPaint(new GradientPaint(0.0F, 0.0F, Color.white, 0.0F, 1000F, Color.blue)); plot.getDomainAxis().setVerticalTickLabels(true); plot.getDomainAxis().setTickLabelFont(TIMES_NEW_ROMAN_8_PLAIN); plot.getRangeAxis().setTickLabelFont(TIMES_NEW_ROMAN_8_PLAIN); // RectangleInsets insets = plot.getRangeAxis().getTickLabelInsets(); // insets.ZERO_INSETS; plot.getRangeAxis().setTickLabelInsets(RectangleInsets.ZERO_INSETS); plot.getRangeAxis().setLabelFont(TIMES_NEW_ROMAN_8_PLAIN); AxisSpace as = new AxisSpace(); // as.setBottom(10); as.setLeft(25); // as.setRight(0); // as.setTop(0); plot.setFixedRangeAxisSpace(as); plot.setNoDataMessage(NO_DATA_MSG); } /** * @param legend */ public static final void configureTitle(TextTitle title) { title.setFont(FONT_ARIAL_8_PLAIN); } } Thank you, and if you need more code I'll reply fast. Thanks again. Maybe the .jrxml : Code:[code] <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="EncoursParEcheanceChart" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="595" columnSpacing="0" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" whenNoDataType="AllSectionsNoDetail" scriptletClass="com.lds.noee.ent.noyau.reporting.synthesePeriodique.position.EncoursParEcheanceScriptlet" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="2" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <reportFont name="Detail_6" isDefault="false" fontName="Arial" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/> <reportFont name="Header_6_Bold" isDefault="false" fontName="Arial" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/> <reportFont name="Footer_6_Bold" isDefault="false" fontName="Arial" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/> <reportFont name="Title_10_Bold" isDefault="false" fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/> <reportFont name="BasPage_8_Italic" isDefault="false" fontName="Arial" size="8" isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1250" isPdfEmbedded="true"/> <reportFont name="Detail_10" isDefault="false" fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/> <reportFont name="Header_10_Bold" isDefault="false" fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/> <parameter name="prmIsSubReport" isForPrompting="false" class="java.lang.Boolean"> <parameterDescription><![CDATA[Dit si le template est exploité comme sub ou pas]]></parameterDescription> <defaultValueExpression ><![CDATA[java.lang.Boolean.FALSE]]></defaultValueExpression> </parameter> <parameter name="prmReportTitle" isForPrompting="false" class="java.lang.String"> <parameterDescription><![CDATA[Le titre du report]]></parameterDescription> </parameter> <parameter name="prmEntNom" isForPrompting="false" class="java.lang.String"/> <parameter name="prmEntCode" isForPrompting="false" class="java.lang.String"/> <variable name="varChartEncours" class="net.sf.jasperreports.engine.JRRenderable" resetType="Report" calculation="System"> </variable> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="0" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="0" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="0" isSplitAllowed="false" > </band> </columnHeader> <detail> <band height="405" isSplitAllowed="false" > <image scaleImage="FillFrame" vAlign="Top" hAlign="Left" isUsingCache="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement mode="Opaque" x="2" y="5" width="590" height="400" forecolor="#000000" backcolor="#FFFFFF" key="image-1" stretchType="NoStretch" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin" fill="Solid" /> <imageExpression class="net.sf.jasperreports.engine.JRRenderable"><![CDATA[$V{varChartEncours}]]></imageExpression> </image> </band> </detail> <columnFooter> <band height="0" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="0" isSplitAllowed="true" > </band> </pageFooter> <summary> <band height="0" isSplitAllowed="false" > </band> </summary> </jasperReport> Post edited by: louis.gely, at: 2006/09/04 12:59