← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2667: Bug Fixed in DataAnalyser

 

------------------------------------------------------------
revno: 2667
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2011-01-20 15:27:02 +0530
message:
  Bug Fixed in DataAnalyser
modified:
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisDataAction.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 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisDataAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisDataAction.java	2011-01-17 06:56:53 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisDataAction.java	2011-01-20 09:57:02 +0000
@@ -208,9 +208,21 @@
         String[] partsOfDEandOptionCombo = availableDataElements.split(":");
         selectedDataElement = dataElementService.getDataElement( Integer.parseInt( partsOfDEandOptionCombo[0] ) );
         selDECOptCombo = dataElementCategoryService.getDataElementCategoryOptionCombo( Integer.parseInt( partsOfDEandOptionCombo[1] ) );
-
-        chartTitle = "Facility : " + selectedOrgUnit.getShortName();
-        chartTitle += "\nDataElement : " + selectedDataElement.getName() + " " + selDECOptCombo.getName();
+        
+        if( ougGroupSetCB != null )
+        {
+            OrganisationUnitGroup orgUnitGroup = organisationUnitGroupService.getOrganisationUnitGroup( orgUnitGroupList );
+            chartTitle = "Facility : " + selectedOrgUnit.getShortName() + " ( " + orgUnitGroup.getName() + " ) " ;
+            chartTitle += "\nDataElement : " + selectedDataElement.getName() + " " + selDECOptCombo.getName();
+        }
+        else
+        {
+            chartTitle = "Facility : " + selectedOrgUnit.getShortName();
+            chartTitle += "\nDataElement : " + selectedDataElement.getName() + " " + selDECOptCombo.getName();
+        }
+        
+       // chartTitle = "Facility : " + selectedOrgUnit.getShortName();
+       // chartTitle += "\nDataElement : " + selectedDataElement.getName() + " " + selDECOptCombo.getName();
 
         deTargetMemberList = new ArrayList<DeTargetMember>( deTargetService.getDeTargetsByDataElementAndCategoryOptionCombo( selectedDataElement, selDECOptCombo ) );
 
@@ -261,6 +273,7 @@
                 }
                 
                 deTargetAggVal = deTargetAggVal/ (12 * yearlyPeriods.size());
+                deTargetAggVal = Math.round( deTargetAggVal * Math.pow( 10, 1 ) ) / Math.pow( 10, 1 );
                 
                 series2[i] = deTarget.getName();
                 
@@ -268,7 +281,8 @@
                 {
                     if( selButton.equalsIgnoreCase( "VIEWCCHART" ) )
                     {
-                        deTargetAggVal = deTargetAggVal * (j+1); 
+                        deTargetAggVal = deTargetAggVal * (j+1);
+                        deTargetAggVal = Math.round( deTargetAggVal * Math.pow( 10, 1 ) ) / Math.pow( 10, 1 );
                     }
                     
                     data2[i][j] = deTargetAggVal;
@@ -357,7 +371,7 @@
             
             serviceValues[countForServiceList][countForPeriodList] = aggDataValue;
             
-            serviceValues[countForServiceList][countForPeriodList] = Math.round( serviceValues[countForServiceList][countForPeriodList] * Math.pow( 10, 2 ) ) / Math.pow( 10, 2 );
+            serviceValues[countForServiceList][countForPeriodList] = Math.round( serviceValues[countForServiceList][countForPeriodList] * Math.pow( 10, 1 ) ) / Math.pow( 10, 1 );
             
             SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "MMM-yyyy" );
             categories1[countForPeriodList] = simpleDateFormat.format( p.getStartDate() );