← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4986: minor chart changes

 

------------------------------------------------------------
revno: 4986
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-10-20 14:45:10 +0200
message:
  minor chart changes
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-10-20 09:35:23 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2011-10-20 12:45:10 +0000
@@ -828,14 +828,30 @@
 
             List<Indicator> indicators = chart.getIndicators();
             List<DataElement> dataElements = chart.getDataElements();
+            List<DataSet> dataSets = chart.getDataSets();
 
             boolean isIndicatorChart = chart.isDimension( DIMENSION_INDICATOR_PERIOD )
                 || chart.isDimension( DIMENSION_ORGANISATIONUNIT_INDICATOR )
                 || chart.isDimension( DIMENSION_PERIOD_INDICATOR );
 
-            boolean isDataElementChart = !isIndicatorChart;
-
-            int loopSize = isIndicatorChart ? indicators.size() : dataElements.size();
+            boolean isDataElementChart = chart.isDimension( DIMENSION_DATAELEMENT_PERIOD )
+                || chart.isDimension( DIMENSION_ORGANISATIONUNIT_DATAELEMENT )
+                || chart.isDimension( DIMENSION_PERIOD_DATAELEMENT );
+
+            boolean isCompletenessChart = chart.isDimension( DIMENSION_COMPLETENESS_PERIOD )
+                || chart.isDimension( DIMENSION_ORGANISATIONUNIT_COMPLETENESS )
+                || chart.isDimension( DIMENSION_PERIOD_COMPLETENESS );
+
+            int loopSize = indicators.size();
+
+            if ( isDataElementChart )
+            {
+                loopSize = dataElements.size();
+            }
+            else if ( isCompletenessChart )
+            {
+                loopSize = dataSets.size();
+            }
 
             for ( int i = 0; i < loopSize; i++ )
             {