← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3328: WIP: small fix to pie charts

 

------------------------------------------------------------
revno: 3328
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2011-04-09 19:21:45 +0200
message:
  WIP: small fix to pie charts
modified:
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2011-04-08 15:39:44 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2011-04-09 17:21:45 +0000
@@ -434,15 +434,19 @@
         else if ( chart.isType( TYPE_PIE ) )
         {
             JFreeChart multiplePieChart = ChartFactory.createMultiplePieChart( chart.getTitle(), dataSets[0],
-                TableOrder.BY_ROW, !chart.getHideLegend(), true, false );
+                TableOrder.BY_ROW, !chart.getHideLegend(), false, false );
             multiplePieChart.setBackgroundPaint( Color.WHITE );
             multiplePieChart.setAntiAlias( true );
 
+            TextTitle title = multiplePieChart.getTitle();
+            title.setFont( titleFont );
+
             MultiplePiePlot multiplePiePlot = (MultiplePiePlot) multiplePieChart.getPlot();
             PiePlot piePlot = (PiePlot) multiplePiePlot.getPieChart().getPlot();
             piePlot.setBackgroundPaint( Color.WHITE );
             piePlot.setShadowXOffset( 0 );
             piePlot.setShadowYOffset( 0 );
+            piePlot.setLabelGenerator( null );
 
             for ( int i = 0; i < dataSets[0].getColumnCount(); i++ )
             {
@@ -454,7 +458,7 @@
         else if ( chart.isType( TYPE_PIE3D ) )
         {
             JFreeChart multiplePieChart = ChartFactory.createMultiplePieChart3D( chart.getTitle(), dataSets[0],
-                TableOrder.BY_ROW, !chart.getHideLegend(), true, false );
+                TableOrder.BY_ROW, !chart.getHideLegend(), false, false );
             multiplePieChart.setBackgroundPaint( Color.WHITE );
             multiplePieChart.setAntiAlias( true );