← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4987: mostly subtitle fixes (charts)

 

------------------------------------------------------------
revno: 4987
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-10-20 14:52:57 +0200
message:
  mostly subtitle fixes (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-10-20 12:45:10 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2011-10-20 12:52:57 +0000
@@ -869,10 +869,16 @@
                 {
                     shortName = dataElements.get( i ).getShortName();
                 }
+                else if ( isCompletenessChart )
+                {
+                    shortName = dataSets.get( i ).getShortName();
+                }
 
                 if ( chart.isDimension( DIMENSION_PERIOD_INDICATOR ) || chart.isDimension( DIMENSION_INDICATOR_PERIOD )
                     || chart.isDimension( DIMENSION_PERIOD_DATAELEMENT )
-                    || chart.isDimension( DIMENSION_DATAELEMENT_PERIOD ) )
+                    || chart.isDimension( DIMENSION_DATAELEMENT_PERIOD )
+                    || chart.isDimension( DIMENSION_PERIOD_COMPLETENESS )
+                    || chart.isDimension( DIMENSION_COMPLETENESS_PERIOD ) )
                 {
                     // ---------------------------------------------------------
                     // Regular dataset
@@ -896,9 +902,14 @@
                                     period.getEndDate(), selectedOrganisationUnit ) : aggregatedDataValueService
                                 .getAggregatedValue( dataElements.get( i ), period, selectedOrganisationUnit );
                         }
+                        else if ( isCompletenessChart )
+                        {
+                            // Completeness value here
+                        }
 
                         if ( chart.isDimension( DIMENSION_PERIOD_INDICATOR )
-                            || chart.isDimension( DIMENSION_PERIOD_DATAELEMENT ) )
+                            || chart.isDimension( DIMENSION_PERIOD_DATAELEMENT )
+                            || chart.isDimension( DIMENSION_PERIOD_COMPLETENESS ) )
                         {
                             regularDataSet.addValue( value != null ? value : 0, shortName, chart.getFormat()
                                 .formatPeriod( period ) );
@@ -943,7 +954,8 @@
                     }
                 }
                 else if ( chart.isDimension( DIMENSION_ORGANISATIONUNIT_INDICATOR )
-                    || chart.isDimension( DIMENSION_ORGANISATIONUNIT_DATAELEMENT ) )
+                    || chart.isDimension( DIMENSION_ORGANISATIONUNIT_DATAELEMENT )
+                    || chart.isDimension( DIMENSION_ORGANISATIONUNIT_COMPLETENESS ) )
                 {
                     // ---------------------------------------------------------
                     // Regular dataset
@@ -967,6 +979,10 @@
                                     selectedPeriod.getEndDate(), unit ) : aggregatedDataValueService
                                 .getAggregatedValue( dataElements.get( i ), selectedPeriod, unit );
                         }
+                        else if ( isCompletenessChart )
+                        {
+                            // Completeness value here
+                        }
 
                         regularDataSet.addValue( value != null ? value : 0, shortName, unit.getShortName() );
 
@@ -1050,11 +1066,11 @@
         {
             subTitle.setText( chart.getAllOrganisationUnits().get( 0 ).getName() );
         }
-        else if ( chart.isDimension( DIMENSION_PERIOD_COMPLETENESS ) && chart.getDataSets().size() > 0 )
+        else if ( chart.isDimension( DIMENSION_PERIOD_COMPLETENESS ) && chart.getAllOrganisationUnits().size() > 0 )
         {
             subTitle.setText( chart.getAllOrganisationUnits().get( 0 ).getName() );
         }
-        else if ( chart.isDimension( DIMENSION_ORGANISATIONUNIT_COMPLETENESS ) && chart.getDataSets().size() > 0 )
+        else if ( chart.isDimension( DIMENSION_ORGANISATIONUNIT_COMPLETENESS ) && chart.getAllPeriods().size() > 0 )
         {
             subTitle.setText( format.formatPeriod( chart.getAllPeriods().get( 0 ) ) );
         }