← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3819: Added subtitle to indicator charts

 

------------------------------------------------------------
revno: 3819
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-06-01 10:57:39 +0200
message:
  Added subtitle to indicator charts
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java
  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-api/src/main/java/org/hisp/dhis/chart/Chart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2011-05-02 12:54:28 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2011-06-01 08:57:39 +0000
@@ -377,10 +377,11 @@
 
     public String getTargetLineLabel()
     {
-        if(targetLineLabel == null || targetLineLabel.length() == 0) {
+        if ( targetLineLabel == null || targetLineLabel.trim().length() == 0 )
+        {
             targetLineLabel = "Target Line";
         }
-        
+
         return targetLineLabel;
     }
 

=== 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-05-02 13:03:18 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2011-06-01 08:57:39 +0000
@@ -553,7 +553,6 @@
 
             plot.addRangeMarker( marker );
         }
-
         
         if ( subTitle )
         {
@@ -744,6 +743,10 @@
         {
             subTitle.setText( format.formatPeriod( chart.getAllPeriods().get( 0 ) ) );
         }
+        else if ( chart.isDimension( DIMENSION_INDICATOR ) && chart.getIndicators().size() > 0 )
+        {
+            subTitle.setText( chart.getAllOrganisationUnits().get( 0 ).getName() );
+        }
 
         return subTitle;
     }