← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5531: PNG and DV chart harmonization

 

------------------------------------------------------------
revno: 5531
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-12-21 23:58:46 +0100
message:
  PNG and DV chart harmonization
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-12-21 22:16:32 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2011-12-21 22:58:46 +0000
@@ -31,6 +31,7 @@
 import static org.hisp.dhis.chart.Chart.TYPE_LINE;
 import static org.hisp.dhis.chart.Chart.TYPE_PIE;
 import static org.hisp.dhis.chart.Chart.TYPE_STACKED_BAR;
+import static org.hisp.dhis.chart.Chart.*;
 import static org.hisp.dhis.reporttable.ReportTable.getIdentifier;
 import static org.hisp.dhis.system.util.ConversionUtils.getArray;
 
@@ -402,7 +403,8 @@
                         metaDataSet.addValue( function.value( periodCount ), "Regression value", period.getName() );
                     }
                 }
-            } catch ( MathException ex )
+            }
+            catch ( MathException ex )
             {
                 throw new RuntimeException( "Failed to interpolate", ex );
             }
@@ -592,11 +594,11 @@
 
         CategoryDataset[] dataSets = getCategoryDataSet( chart );
 
-        if ( chart.isType( TYPE_LINE ) )
+        if ( chart.isType( TYPE_LINE ) || chart.isType( TYPE_AREA ) )
         {
             plot = new CategoryPlot( dataSets[0], new CategoryAxis(), new NumberAxis(), lineRenderer );
         }
-        else if ( chart.isType( TYPE_BAR ) )
+        else if ( chart.isType( TYPE_BAR ) || chart.isType( TYPE_COLUMN ) )
         {
             plot = new CategoryPlot( dataSets[0], new CategoryAxis(), new NumberAxis(), barRenderer );
         }
@@ -604,7 +606,7 @@
         {
             return getMultiplePieChart( chart, dataSets );
         }
-        else if ( chart.isType( TYPE_STACKED_BAR ) )
+        else if ( chart.isType( TYPE_STACKED_BAR ) || chart.isType( TYPE_STACKED_COLUMN ) )
         {
             return getStackedBarChart( chart, dataSets[0] );
         }
@@ -753,7 +755,7 @@
                 
                 Double value = valueMap.get( key );
                 
-                regularDataSet.addValue( value, series.getName(), category.getName() );
+                regularDataSet.addValue( value, series.getShortName(), category.getShortName() );
                 
                 if ( chart.isRegression() && MathUtils.isEqual( value, MathUtils.ZERO ) )
                 {
@@ -776,7 +778,7 @@
 
                     if ( !Double.isNaN( value ) )
                     {
-                        regressionDataSet.addValue( value, TREND_PREFIX + series.getName(), category.getName() );
+                        regressionDataSet.addValue( value, TREND_PREFIX + series.getShortName(), category.getShortName() );
 
                     }
                 }