Jaspersoft BI Tools

iReport,Jaspersoft Design Studio,Jaspersoft Server, Schema Workbench,Analysis,Dashboards, Self Service BI, Domains,Topics,Ad-Hoc Reports, Jaspersoft ETL, Embedding BI,HTML-5 charts, Fusion Charts,JFree Charts,Drill down reports , Drill down Dashboards,Visualize.js, Performance Tuning, D3 Charts, Jaspersoft Customization

Monday, July 15, 2013

JFree Meter chart customization in Jasper iReport-- Removing values from the meter...

Hi..
This artical will teach you how to write custom code for meter chart to remove the values over the meter.
You need to see the text(theroy) part of the post below mentioned before you start trying this

http://jasper-bi-suite.blogspot.in/2013/06/jfree-bar-chart-customization-in.html

For this artical the output would looks some thing like this.


See there are no values over the meter chart... That you achive using the code below.


package com.sadakar.meter.chart.customizer;
import org.jfree.chart.plot.MeterPlot;

public class MeterChartCustomizer implements  net.sf.jasperreports.engine.JRChartCustomizer{

  @Override
    public void customize(org.jfree.chart.JFreeChart chart, net.sf.jasperreports.engine.JRChart jasperChart) 
    {    
       MeterPlot plot = (MeterPlot) chart.getPlot();
       
        for(int i=0; i< plot.getIntervals().size(); i++)
        {
                if(i >0 && i < plot.getIntervals().size()-1)
                    plot.setTickLabelsVisible(false);
        }     
       
         
    }
}

Thanks for reading this artical..

If you have any queries.. you can mail me @ sadakar.1988@gmail.com

:) :) :) 

Other useful blog:

http://passionfordata.blogspot.in/