Jump to content
Changes to the Jaspersoft community edition download ×

DECISIT

Members
  • Posts

    1
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by DECISIT

  1. Or much simpler: package com.ireport.cust;import net.sf.jasperreports.engine.JRChart;import net.sf.jasperreports.engine.JRChartCustomizer;import org.jfree.chart.JFreeChart;import org.jfree.chart.labels.CategoryItemLabelGenerator;import org.jfree.chart.labels.StandardCategoryItemLabelGenerator;import org.jfree.chart.plot.CategoryPlot;import org.jfree.chart.renderer.category.LineAndShapeRenderer;/** * * @author DECISIT */public class LineChartItemLabelCustomizer implements JRChartCustomizer { @Override public void customize(JFreeChart chart, JRChart jasperChart) { CategoryPlot categoryPlot; LineAndShapeRenderer lineAndShapeRenderer; categoryPlot = (CategoryPlot) chart.getPlot(); lineAndShapeRenderer= (LineAndShapeRenderer) categoryPlot.getRenderer(); lineAndShapeRenderer.setBaseItemLabelsVisible(Boolean.TRUE); lineAndShapeRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator) new StandardCategoryItemLabelGenerator()); } } Don't forget to add the created jar to iReport classpath :)
×
×
  • Create New...