Sunday 28 September 2014

Customizing PieCharts in Jasper Reports 

 

Pie charts are a form of an area chart that are easy to understand with a quick look. They show the part of the total (percentage) in an easy-to-understand way. Pie charts are useful tools that help you figure out and understand polls, statistics, complex data, and income or spending. They are so wonderful because everybody can see what is going on. Use them to make excellent visual displays that explain data to other people-- in school projects, work presentations or pitching sales figures to clients. 

Here in this tutorial I will show how to customize PieCharts:

1. ) First drag charts into the report from palette window.

2. ) In the charts window select 2d pie chart.

3. ) Default view of pie chart
  


   4. ) Remove legend and labels by unchecking Show Legend and Show Label from PieChart properties tab .
  




5. ) Now the pie chart would look like this.

 



 6.) Now I will show you how to further customize pie chart , we will create a java project( I have creatred a java project named CustomizedCharts ).

 7.) Add com.mysql jar file , jasperreports jar file , jcommon jar file , jfreecharts jar file.



  8.) Here is the customize code to denote one pie with value January separately.

   9.) Build the project and add classpath to Ireport by clicking Tools->Options->ClassPath->Add Jar
   


   10.) Now Add customizer bar chart by selecting customizer class option.
   

   11.) After putting customized code the chart would look like this.

  12.)  To create full exploded chart view. Here is the code to create full exploded view of piechart


   13.) After applying this code it chart would look like
    




    Hope this article would be helpful.
    Please put your views or questions or suggestions below, I will be more than happy to hear them..

No comments:

Post a Comment