Amazon festival offer

Sunday, 9 June 2013

Basic Chart Properties - 1 (Jasperreport charts)

Chart properties:-
By changing the chart properties, you can present the data in better format and make the chart more visualise. So in this post I will try to change some chart properties of the same chart that I had created in my previous post, these are some basic chart properties:-

      Rotate category axis(X- axis) label :  -
      To rotate category axis, go to the chart property tab and change the
                  Category Axis Tick Label Rotation / Label rotation to            -50.0
      (You can change it according to your requirement)

        Convert data format in special format in iReport : -
       Sometimes you may need to change the date format to some other date format , in case if you
       are using date column in category axis and you want to show the dates in “MMM-yy” format.
       To change the date format of category axis dates, right click on chart, select chart data tab, and
       add this date format
                                  new SimpleDateFormat("MMM-yy").format($F{DataMonth})
       Where $F{DataMonth} will be date column

        Concatenate two columns in iReport :  
      This show you how to concatenate two data filed in iReport
                                            $F{Firstname} + “ - ” + $F{Lastname}
       However, both data should be same data format like if you want to concatenate string and
       integer data filed then first convert integer field to string function.
      To convert integer field to string field add .toString() function.
                                           $F{MONTH} +"-"+$F{YEAR}.toString()
For example:-

I used this in the Series expression of the chart.

No comments: