← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2515: Added DrillDown to DrillDown functionality in Indicator Wise Graphical Analysis in DashBoard

 

------------------------------------------------------------
revno: 2515
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: trunk
timestamp: Tue 2011-01-11 13:34:51 +0530
message:
  Added DrillDown to DrillDown functionality in Indicator Wise Graphical Analysis in DashBoard
added:
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownOrgUnitToPeriodChartIndicatorResultAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownPeriodToOrgChildChartIndicatorResultAction.java
modified:
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartDataElementAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartIndicatorAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownOrgUnitToPeriodChartDataElementResultAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownPeriodToOrgChildChartDataElementResultAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/DashBoardService.java
  local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml
  local/in/dhis-web-dashboard/src/main/resources/struts.xml
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisIndicatorResult.vm


--
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/ga/action/charts/GenerateChartDataElementAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartDataElementAction.java	2011-01-07 05:45:11 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartDataElementAction.java	2011-01-11 08:04:51 +0000
@@ -467,7 +467,7 @@
         selectedValues = new ArrayList<String>();//for DrillDown ( for NBIT)
         selectedStatus = new ArrayList<String>();
         
-        selectedDrillDownData = new ArrayList<String>();//drillDown for periodWise
+        selectedDrillDownData = new ArrayList<String>();//drillDown for periodWise to OrgChildWise and OrgChildWise to periodWise
         
       //  DataElement dElement = new DataElement();
         

=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartIndicatorAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartIndicatorAction.java	2010-12-29 07:47:36 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartIndicatorAction.java	2011-01-11 08:04:51 +0000
@@ -320,6 +320,18 @@
     {
         return denumDataElements;
     }
+    private List<String> selectedDrillDownData;
+    
+    public List<String> getSelectedDrillDownData()
+    {
+        return selectedDrillDownData;
+    }
+    
+    
+    private String drillDownPeriodStartDate;
+    private String drillDownPeriodEndDate;
+    private String drillDownPeriodNames;
+    private String aggChecked;
     // -------------------------------------------------------------------------
     // Action Implementation
     // -------------------------------------------------------------------------
@@ -346,7 +358,22 @@
         /*
          * double d = 4.57767; System.out.println(Math.round(d));
          */
-
+        
+        selectedDrillDownData = new ArrayList<String>();//drillDown for periodWise to OrgChildWise and OrgChildWise to periodWise
+        
+        
+        aggChecked = "";
+        
+        if( aggDataCB != null )
+        {
+            aggChecked = "1";
+        }
+        else
+        {
+            aggChecked = "0";
+        }
+        
+        
         // int flag = 0;
         // selOUList = new ArrayList<OrganisationUnit>();
         selStartPeriodList = new ArrayList<Date>();
@@ -371,7 +398,11 @@
 
         String startD = "";
         String endD = "";
-
+        
+        drillDownPeriodStartDate = "";
+        drillDownPeriodEndDate = "";
+        drillDownPeriodNames = "";
+        
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "MMM-yyyy" );
 
         periodNames = new ArrayList<String>();
@@ -380,6 +411,7 @@
         if ( periodTypeLB.equalsIgnoreCase( WeeklyPeriodType.NAME ) )
         {
           //  System.out.println( " Inside  weekly" );
+            int periodCount = 0;
             for ( String periodStr : periodLB )
             {
                 String  startWeekDate = periodStr.split( "To" )[0] ; //for start week
@@ -388,15 +420,30 @@
                 startD = startWeekDate.trim();
                 endD = endWeekDate.trim();
                 
+                // for DrillDown Period String
+                if( periodCount == periodLB.size()-1 )
+                {
+                    drillDownPeriodStartDate += startD;
+                    drillDownPeriodEndDate += endD;
+                    drillDownPeriodNames += periodStr;
+                }
+                else
+                {
+                    drillDownPeriodStartDate += startD + ";";
+                    drillDownPeriodEndDate += endD + ";";
+                    drillDownPeriodNames += periodStr + ";";
+                }
+                
                 selStartPeriodList.add( format.parseDate( startD ) );
                 selEndPeriodList.add( format.parseDate( endD ) );
                 
                 periodNames.add( periodStr );
+                periodCount++;
                 //System.out.println( startD + " : " + endD );
             }
         }
         else
-        {
+        {   int periodCount = 0;    
             for ( String year : yearLB )
             {
                // int selYear = Integer.parseInt( year.split( "-" )[0] );
@@ -407,6 +454,21 @@
                     startD = "" + selYear + "-01-01";
                     endD = "" + selYear  + "-12-31";
                     
+                   
+                     // for DrillDown Period String
+                    if( periodCount == yearLB.size()-1 )
+                    {
+                        drillDownPeriodStartDate += startD;
+                        drillDownPeriodEndDate += endD;
+                        drillDownPeriodNames += selYear;
+                    }
+                    else
+                    {
+                        drillDownPeriodStartDate += startD + ";";
+                        drillDownPeriodEndDate += endD + ";";
+                        drillDownPeriodNames += selYear + ";";
+                    }
+                    
                     selStartPeriodList.add( format.parseDate( startD ) );
                     selEndPeriodList.add( format.parseDate( endD ) );
         
@@ -436,6 +498,10 @@
                             endD = "" + selYear  + "-" + monthOrder[period] + "-" + ( monthDays[period] + 1 );
                         } 
                         
+                        drillDownPeriodStartDate += startD + ";";
+                        drillDownPeriodEndDate += endD + ";";
+                        drillDownPeriodNames += simpleDateFormat.format( format.parseDate( startD ) ) + ";";
+                        
                         selStartPeriodList.add( format.parseDate( startD ) );
                         selEndPeriodList.add( format.parseDate( endD ) );
                         periodNames.add( simpleDateFormat.format( format.parseDate( startD ) ) );
@@ -449,25 +515,44 @@
                             startD = "" + selYear + "-01-01";
                             endD = "" + selYear + "-03-31";
                             periodNames.add( selYear + "-Q1" );
+                            drillDownPeriodNames += selYear + "-Q1" + ";";
                         }
                         else if ( period == 1 )
                         {
                             startD = "" + selYear + "-04-01";
                             endD = "" + selYear + "-06-30";
                             periodNames.add( selYear + "-Q2" );
+                            drillDownPeriodNames += selYear + "-Q2" + ";";
                         }
                         else if ( period == 2 )
                         {
                             startD = "" + selYear + "-07-01";
                             endD = "" + selYear + "-09-30";
                             periodNames.add( selYear + "-Q3" );
+                            drillDownPeriodNames += selYear + "-Q3" + ";";
                         }
                         else
                         {
                             startD = "" + selYear + "-10-01";
                             endD = "" + selYear + "-12-31";
                             periodNames.add( (selYear) + "-Q4" );
-                        }
+                            drillDownPeriodNames += selYear + "-Q4" + ";";
+                        }
+                       
+                        
+                        // for DrillDown Period String
+                        if( periodCount == periodLB.size()-1 )
+                        {
+                            drillDownPeriodStartDate += startD;
+                            drillDownPeriodEndDate += endD;
+                        }
+                        else
+                        {
+                            drillDownPeriodStartDate += startD + ";";
+                            drillDownPeriodEndDate += endD + ";";
+                        }
+                        
+                        
                         selStartPeriodList.add( format.parseDate( startD ) );
                         selEndPeriodList.add( format.parseDate( endD ) );
                         //System.out.println( "Start Date : " + startD + " , End Date : " + endD );
@@ -480,13 +565,19 @@
                             startD = "" + selYear + "-01-01";
                             endD = "" + selYear + "-06-30";
                             periodNames.add( selYear + "-HY1" );
+                            drillDownPeriodNames += selYear + "-HY1" + ";";
                         }
                         else
                         {
                             startD = "" + selYear + "-07-01";
                             endD = "" + selYear + "-12-31";
                             periodNames.add( selYear + "-HY2" );
+                            drillDownPeriodNames += selYear + "-HY2" + ";";
                         }
+                        
+                        drillDownPeriodStartDate += startD + ";";
+                        drillDownPeriodEndDate += endD + ";";
+                        
                         selStartPeriodList.add( format.parseDate( startD ) );
                         selEndPeriodList.add( format.parseDate( endD ) );
                     }
@@ -512,6 +603,20 @@
                             endD = selYear  + "-" + month + "-" + date;
                         }
                         
+                      // for DrillDown Period String
+                        if( periodCount == periodLB.size()-1 )
+                        {
+                            drillDownPeriodStartDate += startD;
+                            drillDownPeriodEndDate += endD;
+                            drillDownPeriodNames += startD;
+                        }
+                        else
+                        {
+                            drillDownPeriodStartDate += startD + ";";
+                            drillDownPeriodEndDate += endD + ";";
+                            drillDownPeriodNames += startD + ";";
+                        }
+                        
                         selStartPeriodList.add( format.parseDate( startD ) );
                         selEndPeriodList.add( format.parseDate( endD ) );
                         
@@ -520,7 +625,7 @@
                     }
                     System.out.println( startD + " : " + endD );
                 }
-        
+                periodCount++;
             }
     }
         // Indicator Information
@@ -560,8 +665,16 @@
             System.out.println( "Inside PeriodWise Chart Data and group not selected" );
             //System.out.println( "\n\nsize of OrgUnit List : " + selOUList.size() + " , size of Indicator List : " + indicatorList.size() );
             System.out.println( "Chart Generation Start Time is : \t" + new Date() );
-            indicatorChartResult = generateChartDataPeriodWise( selStartPeriodList, selEndPeriodList, periodNames,
-                indicatorList, selOUList.iterator().next() );
+            indicatorChartResult = generateChartDataPeriodWise( selStartPeriodList, selEndPeriodList, periodNames, indicatorList, selOUList.iterator().next() );
+            
+           
+            for( String drillDown : selectedDrillDownData )
+            {
+                System.out.println( "drill Down value is :" + drillDown );
+                System.out.println( "---------");
+            }
+            
+           // dataElementChartResult.getSeries()
 
         }
         else if ( categoryLB.equalsIgnoreCase( CHILDREN ) && ougGroupSetCB == null )
@@ -610,8 +723,7 @@
 
             selOUGroupMemberList.retainAll( orgUnitChildList );
 
-            indicatorChartResult = generateChartDataOrgGroupPeriodWise( selStartPeriodList, selEndPeriodList,
-                periodNames, indicatorList, selOUGroupMemberList );
+            indicatorChartResult = generateChartDataOrgGroupPeriodWise( selStartPeriodList, selEndPeriodList, periodNames, indicatorList, selOUGroupMemberList );
 
         }
 
@@ -643,8 +755,7 @@
 
             selOUGroupMemberList.retainAll( orgUnitChildList );
 
-            indicatorChartResult = generateChartDataSelectedOrgUnitWise( selStartPeriodList, selEndPeriodList,
-                periodNames, indicatorList, selOUGroupMemberList );
+            indicatorChartResult = generateChartDataSelectedOrgUnitWise( selStartPeriodList, selEndPeriodList, periodNames, indicatorList, selOUGroupMemberList );
 
         }
 
@@ -703,9 +814,7 @@
     // Methods for getting Chart Data only Period Wise start
     // -------------------------------------------------------------------------
 
-    public IndicatorChartResult generateChartDataPeriodWise( List<Date> selStartPeriodList,
-        List<Date> selEndPeriodList, List<String> periodNames, List<Indicator> indicatorList, OrganisationUnit orgUnit )
-        throws Exception
+    public IndicatorChartResult generateChartDataPeriodWise( List<Date> selStartPeriodList, List<Date> selEndPeriodList, List<String> periodNames, List<Indicator> indicatorList, OrganisationUnit orgUnit )throws Exception
     {
 
         IndicatorChartResult indicatorChartResult;
@@ -717,10 +826,8 @@
         Double[][] numDataArray = new Double[indicatorList.size()][selStartPeriodList.size()];
         Double[][] denumDataArray = new Double[indicatorList.size()][selStartPeriodList.size()];
 
-        // Map<Integer, List<Double>> numData = new HashMap<Integer,
-        // List<Double>>();
-        // Map<Integer, List<Double>> denumData = new HashMap<Integer,
-        // List<Double>>();
+        // Map<Integer, List<Double>> numData = new HashMap<Integer, List<Double>>();
+        // Map<Integer, List<Double>> denumData = new HashMap<Integer, List<Double>>();
 
         String chartTitle = "OrganisationUnit : " + orgUnit.getShortName();
         String xAxis_Title = "Time Line";
@@ -742,36 +849,37 @@
             for ( Date startDate : selStartPeriodList )
             {
                 Date endDate = selEndPeriodList.get( periodCount );
+                String drillDownPeriodName = periodNames.get( periodCount );
 
                 categories[periodCount] = periodNames.get( periodCount );
+                
+                String tempStartDate = format.formatDate( startDate );
+                String tempEndDate   = format.formatDate( endDate );
 
                 Double aggIndicatorValue = 0.0;
                 Double aggIndicatorNumValue = 0.0;
                 Double aggIndicatorDenumValue = 0.0;
+                String drillDownData = orgUnit.getId() + ":" + "0" + ":" + indicator.getId() + ":" + periodTypeLB + ":" + tempStartDate + ":" + tempEndDate + ":" + drillDownPeriodName + ":" + aggChecked;
+                selectedDrillDownData.add( drillDownData );
+                
                 if ( aggDataCB != null )
                 {
-                    aggIndicatorValue = aggregationService.getAggregatedIndicatorValue( indicator, startDate, endDate,
-                        orgUnit );
-
-                    aggIndicatorNumValue = aggregationService.getAggregatedNumeratorValue( indicator, startDate,
-                        endDate, orgUnit );
-                    aggIndicatorDenumValue = aggregationService.getAggregatedDenominatorValue( indicator, startDate,
-                        endDate, orgUnit );
-
-                    if ( aggIndicatorValue == null )
-                        aggIndicatorValue = 0.0;
+                    aggIndicatorValue = aggregationService.getAggregatedIndicatorValue( indicator, startDate, endDate, orgUnit );
+
+                    aggIndicatorNumValue = aggregationService.getAggregatedNumeratorValue( indicator, startDate, endDate, orgUnit );
+                    aggIndicatorDenumValue = aggregationService.getAggregatedDenominatorValue( indicator, startDate, endDate, orgUnit );
+
+                    if ( aggIndicatorValue == null ) aggIndicatorValue = 0.0;
 
                 }
                 else
                 {
-                    aggIndicatorValue = dashBoardService.getIndividualIndicatorValue( indicator, orgUnit, startDate,
-                        endDate );
+                    aggIndicatorValue = dashBoardService.getIndividualIndicatorValue( indicator, orgUnit, startDate, endDate );
 
                    // System.out.println( " \nIndicator Numerator value  : " + indicator.getNumerator()
                       //  + ", Start Date :- " + startDate + ", End Date :- " + endDate + ", Org Unit :- " + orgUnit );
 
-                    String tempStr = reportService.getIndividualResultDataValue( indicator.getNumerator(), startDate,
-                        endDate, orgUnit, "" );
+                    String tempStr = reportService.getIndividualResultDataValue( indicator.getNumerator(), startDate, endDate, orgUnit, "" );
                    // System.out.println( " \nIndicatorNumerator valu is " + tempStr );
 
                     try
@@ -783,8 +891,7 @@
                         aggIndicatorNumValue = 0.0;
                     }
 
-                    tempStr = reportService.getIndividualResultDataValue( indicator.getDenominator(), startDate,
-                        endDate, orgUnit, "" );
+                    tempStr = reportService.getIndividualResultDataValue( indicator.getDenominator(), startDate, endDate, orgUnit, "" );
 
                     try
                     {
@@ -864,6 +971,9 @@
             {
 
                 categories[childCount] = orgChild.getName();
+                
+                String drillDownData = orgChild.getId() + ":" + "0" + ":" + indicator.getId() + ":"+ periodTypeLB + ":" + drillDownPeriodStartDate + ":" + drillDownPeriodEndDate + ":" + drillDownPeriodNames + ":" + aggChecked;
+                selectedDrillDownData.add( drillDownData );
 
                 Double aggIndicatorValue = 0.0;
                 Double aggIndicatorNumValue = 0.0;
@@ -1005,6 +1115,8 @@
             for ( OrganisationUnit orgUnit : selOUList )
             {
                 categories[orgUnitCount] = orgUnit.getName();
+                String drillDownData = orgUnit.getId() + ":" + "0" + ":" + indicator.getId() + ":" + periodTypeLB + ":" + drillDownPeriodStartDate + ":" + drillDownPeriodEndDate + ":" + drillDownPeriodNames + ":" + aggChecked;
+                selectedDrillDownData.add( drillDownData );
 
                 Double aggIndicatorValue = 0.0;
                 Double aggIndicatorNumValue = 0.0;
@@ -1137,8 +1249,7 @@
         Double[][] denumDataArray = new Double[indicatorList.size()][selStartPeriodList.size()];
         Double[][] data = new Double[indicatorList.size()][selStartPeriodList.size()];
 
-        String chartTitle = "OrganisationUnit : " + selectedOrgUnit.getShortName() + "(" + selOrgUnitGroup.getName()
-            + ")";
+        String chartTitle = "OrganisationUnit : " + selectedOrgUnit.getShortName() + "( Group - " + selOrgUnitGroup.getName() + " )";
         String xAxis_Title = "Time Line";
         String yAxis_Title = "Value";
 
@@ -1161,7 +1272,15 @@
             {
                 Date endDate = selEndPeriodList.get( periodCount );
                 categories[periodCount] = periodNames.get( periodCount );
-
+                
+                String tempStartDate = format.formatDate( startDate );
+                String tempEndDate   = format.formatDate( endDate );
+                String drillDownPeriodName = periodNames.get( periodCount );
+                
+                
+                String drillDownData = selectedOrgUnit.getId() + ":"+ selOrgUnitGroup.getId() + ":" + indicator.getId() + ":"  + periodTypeLB + ":" + tempStartDate + ":" + tempEndDate + ":" + drillDownPeriodName + ":" + aggChecked;
+                //selectedDrillDownData
+                selectedDrillDownData.add( drillDownData );
                 int orgGroupCount = 0;
 
                 for ( OrganisationUnit orgUnit : selOUGroupMemberList )
@@ -1313,6 +1432,9 @@
                 Double aggIndicatorDenumValue = 0.0;
 
                 categories[orgGroupCount] = orgUnitGroup.getName();
+                
+                String drillDownData = selectedOrgUnit.getId() + ":" + orgUnitGroup.getId() + ":" + indicator.getId() + ":" + periodTypeLB + ":" + drillDownPeriodStartDate + ":" + drillDownPeriodEndDate + ":" + drillDownPeriodNames + ":"  + aggChecked;
+                selectedDrillDownData.add( drillDownData );
 
                 if ( serviceCount == 0 )
                 {

=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownOrgUnitToPeriodChartDataElementResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownOrgUnitToPeriodChartDataElementResultAction.java	2011-01-07 05:45:11 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownOrgUnitToPeriodChartDataElementResultAction.java	2011-01-11 08:04:51 +0000
@@ -230,7 +230,7 @@
     
     //private String drillDownPeriodStartDate;
     //private String drillDownPeriodEndDate;
-    private String drillDownPeriodNames;
+    //private String drillDownPeriodNames;
     
     // -------------------------------------------------------------------------
     // Action implements
@@ -281,7 +281,7 @@
         
         //drillDownPeriodStartDate = values[5];
         //drillDownPeriodEndDate = values[6];
-        drillDownPeriodNames = values[7];
+        //drillDownPeriodNames = values[7];
         
         startDateArray = values[5].split( ";" );
         //String startDateArray[] = startDateString.split(";");  
@@ -328,10 +328,11 @@
             int periodCount = 0;
             for( Date startDate : selStartPeriodList )
             {
+                String drillDownPeriodName = periodNames.get( periodCount );
                 Date endDate = selEndPeriodList.get( periodCount );
                 String tempStartDate = format.formatDate( startDate );
                 String tempEndDate   = format.formatDate( endDate );
-                String drillDownData = selectedOrgUnit.getId() + ":" + "0" + ":" + dataElement.getId() + ":"+ categoryCombo.getId() + ":"  + periodTypeLB + ":" + tempStartDate + ":" + tempEndDate + ":" + drillDownPeriodNames + ":" + deSelection + ":" + aggDataCB;
+                String drillDownData = selectedOrgUnit.getId() + ":" + "0" + ":" + dataElement.getId() + ":"+ categoryCombo.getId() + ":"  + periodTypeLB + ":" + tempStartDate + ":" + tempEndDate + ":" + drillDownPeriodName + ":" + deSelection + ":" + aggDataCB;
                 selectedDrillDownData.add( drillDownData );
                 periodCount++;
             }
@@ -344,10 +345,11 @@
             int periodCount = 0;
             for( Date startdate : selStartPeriodList )
             {
+                String drillDownPeriodName = periodNames.get( periodCount );
                 Date endDate = selEndPeriodList.get( periodCount );
                 String tempStartDate = format.formatDate( startdate );
                 String tempEndDate   = format.formatDate( endDate );
-                String drillDownData = selectedOrgUnit.getId() + ":" + "0" + ":" + dataElement.getId() + ":"+ categoryCombo.getId() + ":"  + periodTypeLB + ":" + tempStartDate + ":" + tempEndDate + ":" + drillDownPeriodNames + ":" + deSelection + ":" + aggDataCB;
+                String drillDownData = selectedOrgUnit.getId() + ":" + "0" + ":" + dataElement.getId() + ":"+ categoryCombo.getId() + ":"  + periodTypeLB + ":" + tempStartDate + ":" + tempEndDate + ":" + drillDownPeriodName + ":" + deSelection + ":" + aggDataCB;
                 selectedDrillDownData.add( drillDownData );
                 periodCount++;
             }
@@ -358,11 +360,11 @@
         //if( orgUnitGroup != 0 && categoryLB.equalsIgnoreCase( SELECTED ) )
         {
             //System.out.println( "Inside the method when orgUnit view by selected and group checked" );
-            dataElementChartResult = dashBoardService.generateChartDataWithGroupToPeriodWise( selStartPeriodList, selEndPeriodList, periodNames ,periodTypeLB, dataElementList, deSelection, selectedOptionComboList, selectedOrgUnit, selectedOrgUnitGroup ,aggDataCB );
+            dataElementChartResult = dashBoardService.generateDataElementChartDataWithGroupToPeriodWise( selStartPeriodList, selEndPeriodList, periodNames ,periodTypeLB, dataElementList, deSelection, selectedOptionComboList, selectedOrgUnit, selectedOrgUnitGroup ,aggDataCB );
         }
         else
         {
-            dataElementChartResult = dashBoardService.generateChartDataWithPeriodWise( selStartPeriodList, selEndPeriodList,periodNames, periodTypeLB, dataElementList, deSelection, selectedOptionComboList, selectedOrgUnit, aggDataCB );
+            dataElementChartResult = dashBoardService.generateDataElementChartDataWithPeriodWise( selStartPeriodList, selEndPeriodList,periodNames, periodTypeLB, dataElementList, deSelection, selectedOptionComboList, selectedOrgUnit, aggDataCB );
         }
         
         ActionContext ctx = ActionContext.getContext();

=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownOrgUnitToPeriodChartIndicatorResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownOrgUnitToPeriodChartIndicatorResultAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownOrgUnitToPeriodChartIndicatorResultAction.java	2011-01-11 08:04:51 +0000
@@ -0,0 +1,368 @@
+/*
+ * Copyright (c) 2004-2010, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.hisp.dhis.dataanalyser.ga.action.charts;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.amplecode.quick.StatementManager;
+import org.apache.struts2.ServletActionContext;
+import org.apache.velocity.tools.generic.ListTool;
+import org.hisp.dhis.dataanalyser.util.DashBoardService;
+import org.hisp.dhis.dataanalyser.util.IndicatorChartResult;
+import org.hisp.dhis.i18n.I18nFormat;
+import org.hisp.dhis.indicator.Indicator;
+import org.hisp.dhis.indicator.IndicatorService;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+
+import com.opensymphony.xwork2.Action;
+import com.opensymphony.xwork2.ActionContext;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ *
+ * @version GenerateDrillDownOrgUnitToPeriodChartIndicatorResultAction.java Jan 8, 2011 5:49:39 PM
+ */
+public class GenerateDrillDownOrgUnitToPeriodChartIndicatorResultAction implements Action
+{
+    private final String PERIODWISE = "period";
+
+    //private final String CHILDREN = "children";
+
+   // private final String OPTIONCOMBO = "optioncombo";
+    //private final String SELECTED = "random";
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+    
+    private StatementManager statementManager;
+
+    public void setStatementManager( StatementManager statementManager )
+    {
+        this.statementManager = statementManager;
+    }
+   
+    private DashBoardService dashBoardService;
+
+    public void setDashBoardService( DashBoardService dashBoardService )
+    {
+        this.dashBoardService = dashBoardService;
+    }
+
+    private IndicatorService indicatorService;
+
+    public void setIndicatorService( IndicatorService indicatorService )
+    {
+        this.indicatorService = indicatorService;
+    }
+
+    private OrganisationUnitService organisationUnitService;
+
+    public OrganisationUnitService getOrganisationUnitService()
+    {
+        return organisationUnitService;
+    }
+
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+    
+    private OrganisationUnitGroupService organisationUnitGroupService;
+    
+    public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService )
+    {
+        this.organisationUnitGroupService = organisationUnitGroupService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input/output
+    // -------------------------------------------------------------------------
+    
+    private String categoryLB;
+
+    public void setCategoryLB( String categoryLB )
+    {
+        this.categoryLB = categoryLB;
+    }
+
+    public String getCategoryLB()
+    {
+        return categoryLB;
+    }
+
+    /* 
+    private String ougGroupSetCB;
+    
+    
+    public void setOugGroupSetCB( String ougGroupSetCB )
+    {
+        this.ougGroupSetCB = ougGroupSetCB;
+    }
+    */
+    private I18nFormat format;
+
+    public void setFormat( I18nFormat format )
+    {
+        this.format = format;
+    }
+    
+    private String selDrillDownData;
+    
+    public void setSelDrillDownData( String selDrillDownData )
+    {
+        this.selDrillDownData = selDrillDownData;
+    }
+
+    public String[] values;
+    
+    ListTool listTool;
+
+    public ListTool getListTool()
+    {
+        return listTool;
+    }
+    
+    private IndicatorChartResult indicatorChartResult;
+
+    public IndicatorChartResult getIndicatorChartResult()
+    {
+        return indicatorChartResult;
+    }
+    
+    private OrganisationUnit selectedOrgUnit;
+    
+    private OrganisationUnitGroup selectedOrgUnitGroup;
+
+    private HttpSession session;
+
+    public HttpSession getSession()
+    {
+        return session;
+    }
+    
+    private List<Date> selStartPeriodList;
+
+    private List<Date> selEndPeriodList;
+    
+    private Indicator indicator;
+    
+    private String selectedButton;
+    
+    public String getSelectedButton()
+    {
+        return selectedButton;
+    }
+
+    public void setSelectedButton( String selectedButton )
+    {
+        this.selectedButton = selectedButton;
+    }
+   /*
+    private String aggDataCB;
+    
+    public void setAggDataCB( String aggDataCB )
+    {
+        this.aggDataCB = aggDataCB;
+    }
+    
+    public String getAggDataCB()
+    {
+        return aggDataCB;
+    }
+    */
+    public String[] startDateArray;
+    public String[] endDateArray;
+    public String[] priodNameArray;
+    
+    private  List<String> periodNames;
+    
+    private List<String> selectedDrillDownData;
+    
+    public List<String> getSelectedDrillDownData()
+    {
+        return selectedDrillDownData;
+    }
+    
+    //private String drillDownPeriodStartDate;
+    //private String drillDownPeriodEndDate;
+   // private String drillDownPeriodNames;
+    
+    // -------------------------------------------------------------------------
+    // Action implements
+    // -------------------------------------------------------------------------
+    
+    public String execute()throws Exception
+    {
+        System.out.println( "Inside Generate DrillDown OrgUnit To Period Indicator Chart  Result Action " );
+        
+        statementManager.initialise();
+        
+        selectedDrillDownData = new ArrayList<String>();//drillDown for periodWise
+        listTool = new ListTool();
+        
+        values = selDrillDownData.split( ":" );
+        
+        int orgunit =Integer.parseInt( values[0] );
+        int orgUnitGroup = Integer.parseInt( values[1]);
+        //System.out.println( " Group Id is " + orgUnitGroup );
+        if ( orgUnitGroup != 0 )
+        {
+            selectedOrgUnitGroup = organisationUnitGroupService.getOrganisationUnitGroup( orgUnitGroup );
+            System.out.println( " Group Name is " + selectedOrgUnitGroup.getName() );
+        }
+        
+        selectedOrgUnit = organisationUnitService.getOrganisationUnit( orgunit );
+        
+        int indicatorId = Integer.parseInt( values[2] );
+        indicator = indicatorService.getIndicator( indicatorId );
+        List<Indicator> indicatorList = new ArrayList<Indicator>();
+        indicatorList.add( indicator );
+        
+        String periodTypeLB = values[3];
+        
+        selStartPeriodList = new ArrayList<Date>();
+        selEndPeriodList = new ArrayList<Date>();
+        periodNames = new ArrayList<String>();
+        
+       // drillDownPeriodStartDate = values[5];
+        //drillDownPeriodEndDate = values[6];
+       // drillDownPeriodNames = values[6];
+        
+        startDateArray = values[4].split( ";" );
+        //String startDateArray[] = startDateString.split(";");  
+        
+        for ( int i = 0 ; i < startDateArray.length ; i++ )
+        {
+            String startD = startDateArray[i];
+            selStartPeriodList.add( format.parseDate( startD ) );
+            //System.out.println( "Start date " + startD );
+        }
+        
+        //String endDateString = values[6];
+        endDateArray = values[5].split( ";" );
+        
+        for ( int i = 0 ; i < endDateArray.length ; i++ )
+        {
+            String startD = endDateArray[i];
+            selEndPeriodList.add( format.parseDate( startD ) );
+            //System.out.println( "End date " + startD );
+        }
+       // selStartPeriodList.add( format.parseDate( startD ) );
+        //selEndPeriodList.add( format.parseDate( endD ) );
+        
+        priodNameArray = values[6].split( ";" );
+        
+        for ( int i = 0 ; i < priodNameArray.length ; i++ )
+        {
+            String startD = priodNameArray[i];
+            periodNames.add( startD );
+        }
+        String aggDataCB = values[7];
+        
+        //String drillDownData = orgUnit.getId() + ":"+ dataElement.getId() + ":"+ decoc.getId() + ":"  + periodType + ":" + tempStartDate + ":" + tempEndDate + ":" + deSelection + ":" + aggDataCB;
+        
+        System.out.println( selStartPeriodList + ":" + selEndPeriodList + ":" + periodNames  + ":"  + periodTypeLB + ":" +  indicatorList+ ":" + selectedOrgUnit + ":" + aggDataCB );
+       // System.out.println( selStartPeriodList.size() + ":" + selEndPeriodList.size() );
+        System.out.println( "Chart Generation Start Time is for drillDown: \t" + new Date() );
+       
+        if( orgUnitGroup == 0 && ( categoryLB.equalsIgnoreCase( PERIODWISE )) ) 
+        {
+            int periodCount = 0;
+            for( Date startDate : selStartPeriodList )
+            {
+               
+                String drillDownPeriodName = periodNames.get( periodCount );
+                Date endDate = selEndPeriodList.get( periodCount );
+                String tempStartDate = format.formatDate( startDate );
+                String tempEndDate   = format.formatDate( endDate );
+                String drillDownData = selectedOrgUnit.getId() + ":" + "0" + ":" + indicator.getId() +  ":"  + periodTypeLB + ":" + tempStartDate + ":" + tempEndDate + ":" + drillDownPeriodName + ":" + aggDataCB;
+                selectedDrillDownData.add( drillDownData );
+                periodCount++;
+            }
+            //System.out.println( "hhhiiiiiiiiiiiiii-------------hhhhhhhhhh" );
+            
+        }
+          
+        if( orgUnitGroup != 0 && ( categoryLB.equalsIgnoreCase( PERIODWISE )) ) 
+        {
+            int periodCount = 0;
+            for( Date startdate : selStartPeriodList )
+            {
+                String drillDownPeriodName = periodNames.get( periodCount );
+                Date endDate = selEndPeriodList.get( periodCount );
+                String tempStartDate = format.formatDate( startdate );
+                String tempEndDate   = format.formatDate( endDate );
+                String drillDownData = selectedOrgUnit.getId() + ":" + "0" + ":" + indicator.getId() + ":" + periodTypeLB + ":" + tempStartDate + ":" + tempEndDate + ":" + drillDownPeriodName + ":" + aggDataCB;
+                selectedDrillDownData.add( drillDownData );
+                periodCount++;
+            }
+        }
+       
+        
+        if( orgUnitGroup != 0 )
+        //if( orgUnitGroup != 0 && categoryLB.equalsIgnoreCase( SELECTED ) )
+        {
+            //System.out.println( "Inside the method when orgUnit view by selected and group checked" );
+           
+            indicatorChartResult = dashBoardService.generateIndicatorChartDataWithGroupToPeriodWise( selStartPeriodList, selEndPeriodList, periodNames ,periodTypeLB, indicatorList, selectedOrgUnit, selectedOrgUnitGroup ,aggDataCB );
+        }
+        else
+        {
+            indicatorChartResult = dashBoardService.generateIndicatorChartDataWithPeriodWise( selStartPeriodList, selEndPeriodList,periodNames, periodTypeLB, indicatorList, selectedOrgUnit, aggDataCB );
+        }
+        
+        ActionContext ctx = ActionContext.getContext();
+        HttpServletRequest req = (HttpServletRequest) ctx.get( ServletActionContext.HTTP_REQUEST );
+
+        session = req.getSession();
+
+        session.setAttribute( "data1", indicatorChartResult.getData() );
+        session.setAttribute( "numDataArray", indicatorChartResult.getNumDataArray() );
+        session.setAttribute( "denumDataArray", indicatorChartResult.getDenumDataArray() );
+        session.setAttribute( "series1", indicatorChartResult.getSeries() );
+        session.setAttribute( "categories1", indicatorChartResult.getCategories() );
+        session.setAttribute( "chartTitle", indicatorChartResult.getChartTitle() );
+        session.setAttribute( "xAxisTitle", indicatorChartResult.getXAxis_Title() );
+        session.setAttribute( "yAxisTitle", indicatorChartResult.getYAxis_Title() );
+
+        statementManager.destroy();
+        System.out.println( "Chart Generation End Time is : \t" + new Date() );
+        return SUCCESS;
+    }
+
+    
+}
+
+

=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownPeriodToOrgChildChartDataElementResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownPeriodToOrgChildChartDataElementResultAction.java	2011-01-07 05:45:11 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownPeriodToOrgChildChartDataElementResultAction.java	2011-01-11 08:04:51 +0000
@@ -63,7 +63,7 @@
 
     private final String CHILDREN = "children";
 
-   private final String SELECTED = "random";
+    private final String SELECTED = "random";
     
     //private final String OPTIONCOMBO = "optioncombo";
     // -------------------------------------------------------------------------
@@ -365,11 +365,11 @@
 */       
         if ( orgUnitGroup != 0 )
         {
-            dataElementChartResult = dashBoardService.generateChartDataWithGroupMemberWise( selStartPeriodList, selEndPeriodList, periodTypeLB, dataElementList, deSelection, selectedOptionComboList, selectedOrgUnit, selectedOrgUnitGroup ,aggDataCB );
+            dataElementChartResult = dashBoardService.generateDataElementChartDataWithGroupMemberWise( selStartPeriodList, selEndPeriodList, periodTypeLB, dataElementList, deSelection, selectedOptionComboList, selectedOrgUnit, selectedOrgUnitGroup ,aggDataCB );
         }
         else
         {
-            dataElementChartResult = dashBoardService.generateChartDataWithChildrenWise( selStartPeriodList, selEndPeriodList, periodTypeLB, dataElementList, deSelection, selectedOptionComboList, selectedOrgUnit, aggDataCB );
+            dataElementChartResult = dashBoardService.generateDataElementChartDataWithChildrenWise( selStartPeriodList, selEndPeriodList, periodTypeLB, dataElementList, deSelection, selectedOptionComboList, selectedOrgUnit, aggDataCB );
         }
 
         ActionContext ctx = ActionContext.getContext();

=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownPeriodToOrgChildChartIndicatorResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownPeriodToOrgChildChartIndicatorResultAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateDrillDownPeriodToOrgChildChartIndicatorResultAction.java	2011-01-11 08:04:51 +0000
@@ -0,0 +1,383 @@
+/*
+ * Copyright (c) 2004-2010, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.hisp.dhis.dataanalyser.ga.action.charts;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.amplecode.quick.StatementManager;
+import org.apache.struts2.ServletActionContext;
+import org.apache.velocity.tools.generic.ListTool;
+import org.hisp.dhis.dataanalyser.util.DashBoardService;
+import org.hisp.dhis.dataanalyser.util.IndicatorChartResult;
+import org.hisp.dhis.i18n.I18nFormat;
+import org.hisp.dhis.indicator.Indicator;
+import org.hisp.dhis.indicator.IndicatorService;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+
+import com.opensymphony.xwork2.Action;
+import com.opensymphony.xwork2.ActionContext;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ *
+ * @version GenerateDrillDownPeriodToOrgChildChartIndicatorResultAction.java Jan 7, 2011 3:00:03 PM
+ */
+public class GenerateDrillDownPeriodToOrgChildChartIndicatorResultAction implements Action
+{
+    // private final String PERIODWISE = "period";
+
+    private final String CHILDREN = "children";
+
+    private final String SELECTED = "random";
+    
+    //private final String OPTIONCOMBO = "optioncombo";
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+ 
+    private StatementManager statementManager;
+
+    public void setStatementManager( StatementManager statementManager )
+    {
+        this.statementManager = statementManager;
+    }
+    
+    private DashBoardService dashBoardService;
+
+    public void setDashBoardService( DashBoardService dashBoardService )
+    {
+        this.dashBoardService = dashBoardService;
+    }
+
+    private IndicatorService indicatorService;
+
+    public void setIndicatorService( IndicatorService indicatorService )
+    {
+        this.indicatorService = indicatorService;
+    }
+
+    private OrganisationUnitService organisationUnitService;
+
+    public OrganisationUnitService getOrganisationUnitService()
+    {
+        return organisationUnitService;
+    }
+
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+    
+    private OrganisationUnitGroupService organisationUnitGroupService;
+    
+    public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService )
+    {
+        this.organisationUnitGroupService = organisationUnitGroupService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input/output
+    // -------------------------------------------------------------------------
+    
+
+    private I18nFormat format;
+
+    public void setFormat( I18nFormat format )
+    {
+        this.format = format;
+    }
+    
+    private String selDrillDownData;
+    
+    public void setSelDrillDownData( String selDrillDownData )
+    {
+        this.selDrillDownData = selDrillDownData;
+    }
+
+    public String[] values;
+    
+    ListTool listTool;
+
+    public ListTool getListTool()
+    {
+        return listTool;
+    }
+    
+    private IndicatorChartResult indicatorChartResult;
+
+    public IndicatorChartResult getIndicatorChartResult()
+    {
+        return indicatorChartResult;
+    }
+    
+    private OrganisationUnit selectedOrgUnit;
+    
+    private OrganisationUnitGroup selectedOrgUnitGroup;
+
+    private Indicator indicator;
+
+    //private DataElementCategoryOptionCombo categoryCombo;
+    
+    private HttpSession session;
+
+    public HttpSession getSession()
+    {
+        return session;
+    }
+    
+    private List<Date> selStartPeriodList;
+
+    private List<Date> selEndPeriodList;
+    
+    private String selectedButton;
+    
+    public String getSelectedButton()
+    {
+        return selectedButton;
+    }
+
+    public void setSelectedButton( String selectedButton )
+    {
+        this.selectedButton = selectedButton;
+    }
+    
+    public String[] startDateArray;
+    public String[] endDateArray;
+    public String[] priodNameArray;
+    
+    private  List<String> periodNames;
+    
+    private String categoryLB;
+
+    public void setCategoryLB( String categoryLB )
+    {
+        this.categoryLB = categoryLB;
+    }
+
+    public String getCategoryLB()
+    {
+        return categoryLB;
+    }
+    private List<String> selectedDrillDownData;
+    
+    public List<String> getSelectedDrillDownData()
+    {
+        return selectedDrillDownData;
+    }
+    
+   // private String drillDownPeriodStartDate;
+   // private String drillDownPeriodEndDate;
+   
+    //private String drillDownPeriodNames;
+    
+    /*
+    private String aggDataCB;
+    
+    public void setAggDataCB( String aggDataCB )
+    {
+        this.aggDataCB = aggDataCB;
+    }
+    
+    public String getAggDataCB()
+    {
+        return aggDataCB;
+    }
+    */
+    
+    private String drillDownPeriodStartDate;
+    private String drillDownPeriodEndDate;
+    private String drillDownPeriodNames;
+    
+    // -------------------------------------------------------------------------
+    // Action implements
+    // -------------------------------------------------------------------------
+    
+    public String execute()throws Exception
+    {
+        
+        statementManager.initialise();
+        
+        selectedDrillDownData = new ArrayList<String>();//drillDown for periodWise to OrgChild wise indicator Data
+       
+        listTool = new ListTool();
+        
+        values = selDrillDownData.split( ":" );
+        
+        int orgunit =Integer.parseInt( values[0] );
+        int orgUnitGroup = Integer.parseInt( values[1]);
+        //System.out.println( " Group Id is " + orgUnitGroup );
+        
+        if ( orgUnitGroup != 0 )
+        {
+            selectedOrgUnitGroup = organisationUnitGroupService.getOrganisationUnitGroup( orgUnitGroup );
+            //System.out.println( " Group Name is " + selectedOrgUnitGroup.getName() );
+        }
+        
+        selectedOrgUnit = organisationUnitService.getOrganisationUnit( orgunit );
+        
+        int indicatorId = Integer.parseInt( values[2] );
+        indicator = indicatorService.getIndicator( indicatorId );
+        List<Indicator> indicatorList = new ArrayList<Indicator>();
+        indicatorList.add( indicator ); 
+        
+        
+        
+        String periodTypeLB = values[3];
+       // String startD = values[5];
+        //String endD = values[6];
+        
+        selStartPeriodList = new ArrayList<Date>();
+        selEndPeriodList = new ArrayList<Date>();
+        periodNames = new ArrayList<String>();
+        
+        drillDownPeriodStartDate = values[4];
+        drillDownPeriodEndDate = values[5];
+        drillDownPeriodNames = values[6];
+        
+        
+        
+        startDateArray = values[4].split( ";" );
+        //String startDateArray[] = startDateString.split(";");  
+        
+        for ( int i = 0 ; i < startDateArray.length ; i++ )
+        {
+            String startD = startDateArray[i];
+            selStartPeriodList.add( format.parseDate( startD ) );
+           // System.out.println( "Start date " + startD );
+        }
+        
+        //String endDateString = values[6];
+        endDateArray = values[5].split( ";" );
+        
+        for ( int i = 0 ; i < endDateArray.length ; i++ )
+        {
+            String startD = endDateArray[i];
+            selEndPeriodList.add( format.parseDate( startD ) );
+           // System.out.println( "End date " + startD );
+        }
+       // selStartPeriodList.add( format.parseDate( startD ) );
+        //selEndPeriodList.add( format.parseDate( endD ) );
+        
+        priodNameArray = values[6].split( ";" );
+        
+        for ( int i = 0 ; i < priodNameArray.length ; i++ )
+        {
+            String periodName = priodNameArray[i];
+            periodNames.add( periodName );
+        }
+       // selStartPeriodList.add( format.parseDate( startD ) );
+        //selEndPeriodList.add( format.parseDate( endD ) );
+        
+       
+        String aggDataCB = values[7];
+        
+        //String drillDownData = orgUnit.getId() + ":"+ dataElement.getId() + ":"+ decoc.getId() + ":"  + periodType + ":" + tempStartDate + ":" + tempEndDate + ":" + deSelection + ":" + aggDataCB;
+        
+        System.out.println( selStartPeriodList + ":" + selEndPeriodList + ":" + periodTypeLB + ":" +  indicatorList+ ":" + selectedOrgUnit + ":" + aggDataCB );
+        System.out.println( "Chart Generation Start Time is for drillDown: \t" + new Date() );
+       
+        
+        if( orgUnitGroup == 0 && ( categoryLB.equalsIgnoreCase( CHILDREN ) || ( categoryLB.equalsIgnoreCase( SELECTED )) )) 
+        {
+           List<OrganisationUnit> childOrgUnitList = new ArrayList<OrganisationUnit>();
+           childOrgUnitList = new ArrayList<OrganisationUnit>( selectedOrgUnit.getChildren());
+           
+           for( OrganisationUnit orgChild : childOrgUnitList )
+           {
+               String drillDownData = orgChild.getId() + ":" + "0" + ":" + indicator.getId() + ":" + periodTypeLB + ":" + drillDownPeriodStartDate + ":" + drillDownPeriodEndDate + ":" + drillDownPeriodNames + ":" + aggDataCB;
+               selectedDrillDownData.add( drillDownData );
+           }
+        }
+       
+        if ( orgUnitGroup != 0 && ( categoryLB.equalsIgnoreCase( CHILDREN ) || ( categoryLB.equalsIgnoreCase( SELECTED )) )) 
+        {
+           // List<OrganisationUnit> childOrgUnitList = new ArrayList<OrganisationUnit>();
+            //childOrgUnitList = new ArrayList<OrganisationUnit>( selectedOrgUnit.getChildren());
+            
+            List<OrganisationUnit> selectedOUGroupMemberList = new ArrayList<OrganisationUnit>( selectedOrgUnitGroup.getMembers() );
+            
+            List<OrganisationUnit> childOrgUnitList = new ArrayList<OrganisationUnit>();
+            childOrgUnitList = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( selectedOrgUnit.getId() ) );
+           
+            selectedOUGroupMemberList.retainAll( childOrgUnitList );
+            
+           for( OrganisationUnit orgChild : selectedOUGroupMemberList )
+           {
+                String drillDownData = orgChild.getId() + ":" + selectedOrgUnitGroup.getId() + ":" + indicator.getId() + ":" + periodTypeLB + ":" + drillDownPeriodStartDate + ":" + drillDownPeriodEndDate + ":" + drillDownPeriodNames + ":"  + aggDataCB;
+                selectedDrillDownData.add( drillDownData );
+           }
+            
+        } 
+/*
+        if ( orgUnitGroup != 0 &&  categoryLB.equals( SELECTED ) )
+           {
+               String drillDownData = selectedOrgUnit.getId() + ":" + selectedOrgUnitGroup.getId() + ":" + dataElement.getId() + ":"+ categoryCombo.getId() + ":"  + periodTypeLB + ":" + drillDownPeriodStartDate + ":" + drillDownPeriodEndDate + ":" + drillDownPeriodNames + ":" + deSelection + ":" + aggDataCB;
+               selectedDrillDownData.add( drillDownData );
+            
+           }
+            
+*/       
+        if ( orgUnitGroup != 0 )
+        {
+            indicatorChartResult = dashBoardService.generateIndicatorChartDataWithGroupMemberWise( selStartPeriodList, selEndPeriodList, periodTypeLB, indicatorList,  selectedOrgUnit, selectedOrgUnitGroup ,aggDataCB );
+        }
+        else
+        {
+            indicatorChartResult = dashBoardService.generateIndicatorChartDataWithChildrenWise( selStartPeriodList, selEndPeriodList, periodTypeLB, indicatorList,selectedOrgUnit, aggDataCB );
+        }
+
+        ActionContext ctx = ActionContext.getContext();
+        HttpServletRequest req = (HttpServletRequest) ctx.get( ServletActionContext.HTTP_REQUEST );
+
+        session = req.getSession();
+
+        session.setAttribute( "data1", indicatorChartResult.getData() );
+        session.setAttribute( "numDataArray", indicatorChartResult.getNumDataArray() );
+        session.setAttribute( "denumDataArray", indicatorChartResult.getDenumDataArray() );
+        session.setAttribute( "series1", indicatorChartResult.getSeries() );
+        session.setAttribute( "categories1", indicatorChartResult.getCategories() );
+        session.setAttribute( "chartTitle", indicatorChartResult.getChartTitle() );
+        session.setAttribute( "xAxisTitle", indicatorChartResult.getXAxis_Title() );
+        session.setAttribute( "yAxisTitle", indicatorChartResult.getYAxis_Title() );
+
+        statementManager.destroy();
+        System.out.println( "Chart Generation End Time is : \t" + new Date() );
+        return SUCCESS;
+    }
+
+    
+}
+
+

=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/DashBoardService.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/DashBoardService.java	2011-01-07 05:45:11 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/DashBoardService.java	2011-01-11 08:04:51 +0000
@@ -768,7 +768,7 @@
     // -------------------------------------------------------------------------
         
  
-    public DataElementChartResult generateChartDataWithChildrenWise( List<Date> selStartPeriodList,List<Date> selEndPeriodList,String  periodTypeLB ,List<DataElement> dataElementList, String deSelection, List<DataElementCategoryOptionCombo> decocList, OrganisationUnit selectedOrgUnit , String aggDataCB ) throws Exception
+    public DataElementChartResult generateDataElementChartDataWithChildrenWise( List<Date> selStartPeriodList,List<Date> selEndPeriodList,String  periodTypeLB ,List<DataElement> dataElementList, String deSelection, List<DataElementCategoryOptionCombo> decocList, OrganisationUnit selectedOrgUnit , String aggDataCB ) throws Exception
     {
        System.out.println( "inside Dashboard Service generateChartDataWithChildrenWise " );
         
@@ -902,7 +902,7 @@
     // -------------------------------------------------------------------------
         
  
-    public DataElementChartResult generateChartDataWithGroupMemberWise( List<Date> selStartPeriodList,List<Date> selEndPeriodList,String  periodTypeLB ,List<DataElement> dataElementList, String deSelection, List<DataElementCategoryOptionCombo> decocList, OrganisationUnit selectedOrgUnit , OrganisationUnitGroup selectedOrgUnitGroup , String aggDataCB ) throws Exception
+    public DataElementChartResult generateDataElementChartDataWithGroupMemberWise( List<Date> selStartPeriodList,List<Date> selEndPeriodList,String  periodTypeLB ,List<DataElement> dataElementList, String deSelection, List<DataElementCategoryOptionCombo> decocList, OrganisationUnit selectedOrgUnit , OrganisationUnitGroup selectedOrgUnitGroup , String aggDataCB ) throws Exception
     {
         System.out.println( "inside Dashboard Service generateChartDataWithGroupMemberWise " );
         
@@ -1040,7 +1040,7 @@
     // -------------------------------------------------------------------------
     
     
-    public DataElementChartResult generateChartDataWithPeriodWise( List<Date> selStartPeriodList,List<Date> selEndPeriodList,List<String> periodNames,String  periodTypeLB ,List<DataElement> dataElementList, String deSelection, List<DataElementCategoryOptionCombo> decocList, OrganisationUnit selectedOrgUnit , String aggDataCB ) throws Exception
+    public DataElementChartResult generateDataElementChartDataWithPeriodWise( List<Date> selStartPeriodList,List<Date> selEndPeriodList,List<String> periodNames,String  periodTypeLB ,List<DataElement> dataElementList, String deSelection, List<DataElementCategoryOptionCombo> decocList, OrganisationUnit selectedOrgUnit , String aggDataCB ) throws Exception
     {
        DataElementChartResult dataElementChartResult;
        
@@ -1158,7 +1158,7 @@
     // Methods for getting Chart Data OrgGroup Period Wise start
     // -------------------------------------------------------------------------
        
-    public DataElementChartResult generateChartDataWithGroupToPeriodWise( List<Date> selStartPeriodList,List<Date> selEndPeriodList,List<String> periodNames,String  periodTypeLB ,List<DataElement> dataElementList, String deSelection, List<DataElementCategoryOptionCombo> decocList, OrganisationUnit selectedOrgUnit , OrganisationUnitGroup selectedOrgUnitGroup , String aggDataCB ) throws Exception
+    public DataElementChartResult generateDataElementChartDataWithGroupToPeriodWise( List<Date> selStartPeriodList,List<Date> selEndPeriodList,List<String> periodNames,String  periodTypeLB ,List<DataElement> dataElementList, String deSelection, List<DataElementCategoryOptionCombo> decocList, OrganisationUnit selectedOrgUnit , OrganisationUnitGroup selectedOrgUnitGroup , String aggDataCB ) throws Exception
     {
        DataElementChartResult dataElementChartResult;
        
@@ -1172,7 +1172,7 @@
        String[] series = new String[dataElementList.size()];
        String[] categories = new String[selStartPeriodList.size()];
        Double[][] data = new Double[dataElementList.size()][selStartPeriodList.size()];
-       String chartTitle = "OrganisationUnit : " + selectedOrgUnit.getShortName()+ "(" + selectedOrgUnitGroup.getName() +  ")";
+       String chartTitle = "OrganisationUnit : " + selectedOrgUnit.getShortName()+ "( Group - " + selectedOrgUnitGroup.getName() +  " )";
        String xAxis_Title = "Time Line";
        String yAxis_Title = "Value";
        
@@ -1264,8 +1264,573 @@
       return dataElementChartResult;
     
    }
+   
     // -------------------------------------------------------------------------
     // Methods for getting Chart Data OrgGroup Period Wise end 
     // -------------------------------------------------------------------------
     
+    
+    // --------------------------------------------------------
+    // for Indicators DrillDown Supportive method   ndicator Wise
+    //---------------------------------------------------------
+   
+    // -------------------------------------------------------------------------
+    // Methods for getting Chart Data With Children Wise start ( this method is called when view by -> periodWise and group not selected ) --ndicator Wise
+    // -------------------------------------------------------------------------
+        
+    
+    public IndicatorChartResult generateIndicatorChartDataWithChildrenWise( List<Date> selStartPeriodList,List<Date> selEndPeriodList, String  periodTypeLB, List<Indicator> indicatorList, OrganisationUnit selectedOrgUnit , String aggDataCB ) throws Exception
+    {
+        System.out.println( "inside Dashboard Service generate Chart Data With Children Wise " );
+        
+        IndicatorChartResult indicatorChartResult;
+        
+        List<OrganisationUnit> childOrgUnitList = new ArrayList<OrganisationUnit>();
+        childOrgUnitList = new ArrayList<OrganisationUnit>( selectedOrgUnit.getChildren());
+        
+        String[] series = new String[indicatorList.size()];
+        String[] categories = new String[childOrgUnitList.size()];
+
+        Double[][] numDataArray = new Double[indicatorList.size()][childOrgUnitList.size()];
+        Double[][] denumDataArray = new Double[indicatorList.size()][childOrgUnitList.size()];
+        Double[][] data = new Double[indicatorList.size()][childOrgUnitList.size()];
+
+        String chartTitle = "OrganisationUnit : " + selectedOrgUnit.getShortName();
+
+        String xAxis_Title = "Facilities";
+        String yAxis_Title = "Value";
+
+        int serviceCount = 0;
+
+        for ( Indicator indicator : indicatorList )
+        {
+            series[serviceCount] = indicator.getName();
+            //yseriesList.add( indicator );
+
+            //numeratorDEList.add( indicator.getNumeratorDescription() );
+           // denominatorDEList.add( indicator.getDenominatorDescription() );
+
+            int childCount = 0;
+            for ( OrganisationUnit orgChild : childOrgUnitList )
+            {
+
+                categories[childCount] = orgChild.getName();
+
+                Double aggIndicatorValue = 0.0;
+                Double aggIndicatorNumValue = 0.0;
+                Double aggIndicatorDenumValue = 0.0;
+                int periodCount = 0;
+                for ( Date startDate : selStartPeriodList )
+                {
+                    Date endDate = selEndPeriodList.get( periodCount );
+
+                   // if ( aggDataCB != null )
+                   // {
+                    int aggChecked = Integer.parseInt( aggDataCB );
+                        
+                    if( aggChecked == 1 )
+                    {
+                        Double tempAggIndicatorNumValue = aggregationService.getAggregatedNumeratorValue( indicator, startDate, endDate, orgChild );
+                        Double tempAggIndicatorDenumValue = aggregationService.getAggregatedDenominatorValue( indicator, startDate, endDate, orgChild );
+
+                        if ( tempAggIndicatorNumValue != null )
+                        {
+                            aggIndicatorNumValue += tempAggIndicatorNumValue;
+
+                        }
+                        if ( tempAggIndicatorDenumValue != null )
+                        {
+                            aggIndicatorDenumValue += tempAggIndicatorDenumValue;
+
+                        }
+
+                    }
+                    else
+                    {
+                        Double tempAggIndicatorNumValue = 0.0;
+                        String tempStr = reportservice.getIndividualResultDataValue( indicator.getNumerator(), startDate, endDate, orgChild, "" );
+                        try
+                        {
+                            tempAggIndicatorNumValue = Double.parseDouble( tempStr );
+                        }
+                        catch ( Exception e )
+                        {
+                            tempAggIndicatorNumValue = 0.0;
+                        }
+                        aggIndicatorNumValue += tempAggIndicatorNumValue;
+
+                        Double tempAggIndicatorDenumValue = 0.0;
+
+                        tempStr = reportservice.getIndividualResultDataValue( indicator.getDenominator(), startDate, endDate, orgChild, "" );
+                        try
+                        {
+                            tempAggIndicatorDenumValue = Double.parseDouble( tempStr );
+                        }
+                        catch ( Exception e )
+                        {
+                            tempAggIndicatorDenumValue = 0.0;
+                        }
+                        aggIndicatorDenumValue += tempAggIndicatorDenumValue;
+
+                    }
+
+                    periodCount++;
+                }
+                try
+                {
+                    // aggIndicatorValue = ( aggIndicatorNumValue /
+                    // aggIndicatorDenumValue )*
+                    // indicator.getIndicatorType().getFactor();
+                    if ( aggIndicatorDenumValue == 0 )
+                    {
+                        aggIndicatorValue = 0.0;
+                    }
+                    else
+                    {
+                        aggIndicatorValue = (aggIndicatorNumValue / aggIndicatorDenumValue) * indicator.getIndicatorType().getFactor();
+                    }
+                }
+                catch ( Exception e )
+                {
+                    aggIndicatorValue = 0.0;
+                }
+                // rounding indicator value ,Numenetor,denumenetor
+                data[serviceCount][childCount] = aggIndicatorValue;
+                data[serviceCount][childCount] = Math.round( data[serviceCount][childCount] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+
+                numDataArray[serviceCount][childCount] = aggIndicatorNumValue;
+                numDataArray[serviceCount][childCount] = Math.round( numDataArray[serviceCount][childCount] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+                
+                denumDataArray[serviceCount][childCount] = aggIndicatorDenumValue;
+                denumDataArray[serviceCount][childCount] = Math.round( denumDataArray[serviceCount][childCount] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+                // data[serviceCount][childCount] = aggDataValue;
+                childCount++;
+            }
+
+            serviceCount++;
+        }
+
+        indicatorChartResult = new IndicatorChartResult( series, categories, data, numDataArray, denumDataArray,chartTitle, xAxis_Title, yAxis_Title );
+        return indicatorChartResult;
+    }
+
+    // -------------------------------------------------------------------------
+    // Methods for getting Chart Data With Children Wise start ( this method is called when view by -> periodWise and group not selected ) End --ndicator Wise
+    // -------------------------------------------------------------------------
+        
+    // -------------------------------------------------------------------------
+    // Methods for getting Chart Data With groupMember Wise start ( this method is called when view by -> periodWise and group  selected ) --- indicator Wise
+    // -------------------------------------------------------------------------
+        
+ 
+    public IndicatorChartResult generateIndicatorChartDataWithGroupMemberWise( List<Date> selStartPeriodList,List<Date> selEndPeriodList,String  periodTypeLB ,List<Indicator> indicatorList, OrganisationUnit selectedOrgUnit , OrganisationUnitGroup selectedOrgUnitGroup , String aggDataCB ) throws Exception
+    {
+        System.out.println( " inside Dashboard Service generate Indicator Chart Data With Group Member Wise " );
+        
+        IndicatorChartResult indicatorChartResult;
+        
+        //OrganisationUnitGroup selOrgUnitGroup = organisationUnitGroupService.getOrganisationUnitGroup(  selectedOrgUnitGroup  );
+        
+        List<OrganisationUnit> selectedOUGroupMemberList = new ArrayList<OrganisationUnit>( selectedOrgUnitGroup.getMembers() );
+       
+        List<OrganisationUnit> childOrgUnitList = new ArrayList<OrganisationUnit>();
+        childOrgUnitList = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( selectedOrgUnit.getId() ) );
+       
+        selectedOUGroupMemberList.retainAll( childOrgUnitList );
+        
+       
+        String[] series = new String[indicatorList.size()];
+        String[] categories = new String[selectedOUGroupMemberList.size()];
+
+        Double[][] numDataArray = new Double[indicatorList.size()][selectedOUGroupMemberList.size()];
+        Double[][] denumDataArray = new Double[indicatorList.size()][selectedOUGroupMemberList.size()];
+        Double[][] data = new Double[indicatorList.size()][selectedOUGroupMemberList.size()];
+        //String chartTitle = "OrganisationUnit : " + selectedOrgUnit.getShortName();
+        String chartTitle = "OrganisationUnit : " + selectedOrgUnit.getShortName()+ "( Group - " + selectedOrgUnitGroup.getName() +  ")";
+       
+      // String chartTitle = "OrganisationUnit : " + orgUnit.getShortName();
+        String xAxis_Title = "Facilities";
+        String yAxis_Title = "Value";
+    
+        //System.out.println("size of children : " +childOrgUnitList.size() + ", Size og GroupMember : " + selectedOUGroupMemberList.size()+ ", size of CommomGroupMember : " + selectedOUGroupMemberList.size());
+       
+        int serviceCount = 0;
+
+        for ( Indicator indicator : indicatorList )
+        {
+            series[serviceCount] = indicator.getName();
+
+            int childCount = 0;
+            for ( OrganisationUnit orgChild : selectedOUGroupMemberList )
+            {
+
+                categories[childCount] = orgChild.getName();
+
+                Double aggIndicatorValue = 0.0;
+                Double aggIndicatorNumValue = 0.0;
+                Double aggIndicatorDenumValue = 0.0;
+                int periodCount = 0;
+                for ( Date startDate : selStartPeriodList )
+                {
+                    Date endDate = selEndPeriodList.get( periodCount );
+
+                    int aggChecked = Integer.parseInt( aggDataCB );
+                    
+                    if( aggChecked == 1 )
+                    {
+
+                        Double tempAggIndicatorNumValue = aggregationService.getAggregatedNumeratorValue( indicator,
+                            startDate, endDate, orgChild );
+                        Double tempAggIndicatorDenumValue = aggregationService.getAggregatedDenominatorValue(
+                            indicator, startDate, endDate, orgChild );
+
+                        if ( tempAggIndicatorNumValue != null )
+                        {
+                            aggIndicatorNumValue += tempAggIndicatorNumValue;
+
+                        }
+                        if ( tempAggIndicatorDenumValue != null )
+                        {
+                            aggIndicatorDenumValue += tempAggIndicatorDenumValue;
+
+                        }
+
+                    }
+                    else
+                    {
+                        Double tempAggIndicatorNumValue = 0.0;
+                        String tempStr = reportservice.getIndividualResultDataValue( indicator.getNumerator(),
+                            startDate, endDate, orgChild, "" );
+                        try
+                        {
+                            tempAggIndicatorNumValue = Double.parseDouble( tempStr );
+                        }
+                        catch ( Exception e )
+                        {
+                            tempAggIndicatorNumValue = 0.0;
+                        }
+                        aggIndicatorNumValue += tempAggIndicatorNumValue;
+
+                        Double tempAggIndicatorDenumValue = 0.0;
+
+                        tempStr = reportservice.getIndividualResultDataValue( indicator.getDenominator(), startDate,
+                            endDate, orgChild, "" );
+                        try
+                        {
+                            tempAggIndicatorDenumValue = Double.parseDouble( tempStr );
+                        }
+                        catch ( Exception e )
+                        {
+                            tempAggIndicatorDenumValue = 0.0;
+                        }
+                        aggIndicatorDenumValue += tempAggIndicatorDenumValue;
+
+                    }
+
+                    periodCount++;
+                }
+                try
+                {
+                    // aggIndicatorValue = ( aggIndicatorNumValue /
+                    // aggIndicatorDenumValue )*
+                    // indicator.getIndicatorType().getFactor();
+                    if ( aggIndicatorDenumValue == 0 )
+                    {
+                        aggIndicatorValue = 0.0;
+                    }
+                    else
+                    {
+                        aggIndicatorValue = (aggIndicatorNumValue / aggIndicatorDenumValue)
+                            * indicator.getIndicatorType().getFactor();
+                    }
+                }
+                catch ( Exception e )
+                {
+                    aggIndicatorValue = 0.0;
+                }
+                // rounding indicator value ,Numenetor,denumenetor
+                data[serviceCount][childCount] = aggIndicatorValue;
+                data[serviceCount][childCount] = Math.round( data[serviceCount][childCount] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+
+                numDataArray[serviceCount][childCount] = aggIndicatorNumValue;
+                numDataArray[serviceCount][childCount] = Math.round( numDataArray[serviceCount][childCount] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+                
+                denumDataArray[serviceCount][childCount] = aggIndicatorDenumValue;
+                denumDataArray[serviceCount][childCount] = Math.round( denumDataArray[serviceCount][childCount] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+                // data[serviceCount][childCount] = aggDataValue;
+                childCount++;
+            }
+
+            serviceCount++;
+        }
+
+        indicatorChartResult = new IndicatorChartResult( series, categories, data, numDataArray, denumDataArray,chartTitle, xAxis_Title, yAxis_Title );
+        return indicatorChartResult;
+    }
+    // -------------------------------------------------------------------------
+    // Methods for getting Chart Data With groupMember Wise start ( this method is called when view by -> periodWise and group  selected ) --- indicator Wise
+    // ------ end
+    
+    // -------------------------------------------------------------------------
+    // for Indicator
+    // Methods for getting Chart Data only Period Wise start ( this method is called when view by ->Selected + children and  Group not selected,and view by -> children and group selected )
+    // -------------------------------------------------------------------------
+    
+    
+    public IndicatorChartResult generateIndicatorChartDataWithPeriodWise( List<Date> selStartPeriodList,List<Date> selEndPeriodList,List<String> periodNames,String  periodTypeLB ,List<Indicator> indicatorList,  OrganisationUnit selectedOrgUnit , String aggDataCB ) throws Exception
+    {
+       System.out.println( "inside Dashboard Service generate Chart Data With Period Wise " );
+       
+       IndicatorChartResult indicatorChartResult;
+
+       String[] series = new String[indicatorList.size()];
+       String[] categories = new String[selStartPeriodList.size()];
+       Double[][] data = new Double[indicatorList.size()][selStartPeriodList.size()];
+
+       Double[][] numDataArray = new Double[indicatorList.size()][selStartPeriodList.size()];
+       Double[][] denumDataArray = new Double[indicatorList.size()][selStartPeriodList.size()];
+
+       // Map<Integer, List<Double>> numData = new HashMap<Integer, List<Double>>();
+       // Map<Integer, List<Double>> denumData = new HashMap<Integer, List<Double>>();
+
+       String chartTitle = "OrganisationUnit : " + selectedOrgUnit.getShortName();
+       String xAxis_Title = "Time Line";
+       String yAxis_Title = "Value";
+
+       int serviceCount = 0;
+       for ( Indicator indicator : indicatorList )
+       {
+           series[serviceCount] = indicator.getName();
+
+           // List<Double> numeratorValueList = new ArrayList<Double>();
+           // List<Double> denumeratorValueList = new ArrayList<Double>();
+
+           int periodCount = 0;
+           for ( Date startDate : selStartPeriodList )
+           {
+               Date endDate = selEndPeriodList.get( periodCount );
+              // String drillDownPeriodName = periodNames.get( periodCount );
+
+               categories[periodCount] = periodNames.get( periodCount );
+
+               Double aggIndicatorValue = 0.0;
+               Double aggIndicatorNumValue = 0.0;
+               Double aggIndicatorDenumValue = 0.0;
+               
+               int aggChecked = Integer.parseInt( aggDataCB );
+               
+               if( aggChecked == 1 )
+               {
+                   aggIndicatorValue = aggregationService.getAggregatedIndicatorValue( indicator, startDate, endDate, selectedOrgUnit );
+
+                   aggIndicatorNumValue = aggregationService.getAggregatedNumeratorValue( indicator, startDate, endDate, selectedOrgUnit );
+                   aggIndicatorDenumValue = aggregationService.getAggregatedDenominatorValue( indicator, startDate, endDate, selectedOrgUnit );
+
+                   if ( aggIndicatorValue == null ) aggIndicatorValue = 0.0;
+
+               }
+               else
+               {
+                   aggIndicatorValue = getIndividualIndicatorValue( indicator, selectedOrgUnit, startDate, endDate );
+
+                  // System.out.println( " \nIndicator Numerator value  : " + indicator.getNumerator()
+                     //  + ", Start Date :- " + startDate + ", End Date :- " + endDate + ", Org Unit :- " + orgUnit );
+
+                   String tempStr = reportservice.getIndividualResultDataValue( indicator.getNumerator(), startDate, endDate, selectedOrgUnit, "" );
+                  // System.out.println( " \nIndicatorNumerator valu is " + tempStr );
+
+                   try
+                   {
+                       aggIndicatorNumValue = Double.parseDouble( tempStr );
+                   }
+                   catch ( Exception e )
+                   {
+                       aggIndicatorNumValue = 0.0;
+                   }
+
+                   tempStr = reportservice.getIndividualResultDataValue( indicator.getDenominator(), startDate, endDate, selectedOrgUnit, "" );
+
+                   try
+                   {
+                       aggIndicatorDenumValue = Double.parseDouble( tempStr );
+                   }
+                   catch ( Exception e )
+                   {
+                       aggIndicatorDenumValue = 0.0;
+                   }
+
+               }
+               // rounding indicator value ,Numenetor,denumenetor
+               data[serviceCount][periodCount] = aggIndicatorValue;
+               data[serviceCount][periodCount] = Math.round( data[serviceCount][periodCount] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+
+               numDataArray[serviceCount][periodCount] = aggIndicatorNumValue;
+               numDataArray[serviceCount][periodCount] = Math.round( numDataArray[serviceCount][periodCount] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+               
+               denumDataArray[serviceCount][periodCount] = aggIndicatorDenumValue;
+               denumDataArray[serviceCount][periodCount] = Math.round( denumDataArray[serviceCount][periodCount] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+               // numeratorValueList.add( aggIndicatorNumValue );
+               // denumeratorValueList.add( aggIndicatorDenumValue );
+
+               periodCount++;
+           }
+
+           // numData.put( serviceCount, numeratorValueList );
+           // denumData.put( serviceCount, denumeratorValueList );
+
+           serviceCount++;
+       }
+
+       indicatorChartResult = new IndicatorChartResult( series, categories, data, numDataArray, denumDataArray,chartTitle, xAxis_Title, yAxis_Title );
+       return indicatorChartResult;
+
+    }
+    
+    // -------------------------------------------------------------------------
+    // Methods for getting Chart Data only Period Wise end
+    // -------------------------------------------------------------------------
+    
+    // -------------------------------------------------------------------------
+    // Methods for getting Chart Data OrgGroup Period Wise start - IndicatorWise
+    // -------------------------------------------------------------------------
+    
+    public IndicatorChartResult generateIndicatorChartDataWithGroupToPeriodWise( List<Date> selStartPeriodList,List<Date> selEndPeriodList,List<String> periodNames,String  periodTypeLB ,List<Indicator> indicatorList, OrganisationUnit selectedOrgUnit , OrganisationUnitGroup selectedOrgUnitGroup , String aggDataCB )
+        throws Exception
+    {
+        IndicatorChartResult indicatorChartResult;
+
+        List<OrganisationUnit> selectedOUGroupMemberList = new ArrayList<OrganisationUnit>( selectedOrgUnitGroup.getMembers() );
+        
+        List<OrganisationUnit> childOrgUnitList = new ArrayList<OrganisationUnit>();
+        childOrgUnitList = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( selectedOrgUnit.getId() ) );
+       
+        selectedOUGroupMemberList.retainAll( childOrgUnitList );
+        
+        String[] series = new String[indicatorList.size()];
+        String[] categories = new String[selStartPeriodList.size()];
+
+        Double[][] numDataArray = new Double[indicatorList.size()][selStartPeriodList.size()];
+        Double[][] denumDataArray = new Double[indicatorList.size()][selStartPeriodList.size()];
+        Double[][] data = new Double[indicatorList.size()][selStartPeriodList.size()];
+
+        String chartTitle = "OrganisationUnit : " + selectedOrgUnit.getShortName() + "( Group - " + selectedOrgUnitGroup.getName() + " )";
+        String xAxis_Title = "Time Line";
+        String yAxis_Title = "Value";
+
+        int serviceCount = 0;
+
+        for ( Indicator indicator : indicatorList )
+        {
+            series[serviceCount] = indicator.getName();
+
+            Double aggIndicatorValue = 0.0;
+            Double aggIndicatorNumValue = 0.0;
+            Double aggIndicatorDenumValue = 0.0;
+
+            int periodCount = 0;
+            for ( Date startDate : selStartPeriodList )
+            {
+                Date endDate = selEndPeriodList.get( periodCount );
+                categories[periodCount] = periodNames.get( periodCount );
+                
+                int orgGroupCount = 0;
+
+                for ( OrganisationUnit orgUnit : selectedOUGroupMemberList )
+                {
+                    int aggChecked = Integer.parseInt( aggDataCB );
+                    
+                    if( aggChecked == 1 )
+                    {
+                        Double tempAggIndicatorNumValue = aggregationService.getAggregatedNumeratorValue( indicator, startDate, endDate, orgUnit );
+                        Double tempAggIndicatorDenumValue = aggregationService.getAggregatedDenominatorValue( indicator, startDate, endDate, orgUnit );
+
+                        if ( tempAggIndicatorNumValue != null )
+                        {
+                            aggIndicatorNumValue += tempAggIndicatorNumValue;
+
+                        }
+                        if ( tempAggIndicatorDenumValue != null )
+                        {
+                            aggIndicatorDenumValue += tempAggIndicatorDenumValue;
+
+                        }
+                    }
+                    else
+                    {
+                        Double tempAggIndicatorNumValue = 0.0;
+
+                        String tempStr = reportservice.getIndividualResultDataValue( indicator.getNumerator(), startDate, endDate, orgUnit, "" );
+                        try
+                        {
+                            tempAggIndicatorNumValue = Double.parseDouble( tempStr );
+                        }
+                        catch ( Exception e )
+                        {
+                            tempAggIndicatorNumValue = 0.0;
+                        }
+                        aggIndicatorNumValue += tempAggIndicatorNumValue;
+
+                        Double tempAggIndicatorDenumValue = 0.0;
+
+                        // tempStr =
+                        // reportService.getIndividualResultIndicatorValue(
+                        // indicator.getDenominator(), startDate, endDate,
+                        // orgUnit );
+                        tempStr = reportservice.getIndividualResultDataValue( indicator.getDenominator(), startDate, endDate, orgUnit, "" );
+                        try
+                        {
+                            tempAggIndicatorDenumValue = Double.parseDouble( tempStr );
+                        }
+                        catch ( Exception e )
+                        {
+                            tempAggIndicatorDenumValue = 0.0;
+                        }
+                        aggIndicatorDenumValue += tempAggIndicatorDenumValue;
+
+                    }
+                    orgGroupCount++;
+                }
+
+                try
+                {
+                    // aggIndicatorValue = ( aggIndicatorNumValue /
+                    // aggIndicatorDenumValue )*
+                    // indicator.getIndicatorType().getFactor();
+                    if ( aggIndicatorDenumValue == 0 )
+                    {
+                        aggIndicatorValue = 0.0;
+                    }
+                    else
+                    {
+                        aggIndicatorValue = (aggIndicatorNumValue / aggIndicatorDenumValue)
+                            * indicator.getIndicatorType().getFactor();
+                    }
+                }
+                catch ( Exception e )
+                {
+                    aggIndicatorValue = 0.0;
+                }
+                // rounding indicator value ,Numenetor,denumenetor
+                data[serviceCount][periodCount] = aggIndicatorValue;
+                data[serviceCount][periodCount] = Math.round( data[serviceCount][periodCount] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+
+                numDataArray[serviceCount][periodCount] = aggIndicatorNumValue;
+                numDataArray[serviceCount][periodCount] = Math.round( numDataArray[serviceCount][periodCount] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+                
+                denumDataArray[serviceCount][periodCount] = aggIndicatorDenumValue;
+                denumDataArray[serviceCount][periodCount] = Math.round( denumDataArray[serviceCount][periodCount] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+                
+                periodCount++;
+            }
+
+            serviceCount++;
+        }
+
+        indicatorChartResult = new IndicatorChartResult( series, categories, data, numDataArray, denumDataArray, chartTitle, xAxis_Title, yAxis_Title );
+        return indicatorChartResult;
+
+    }
+    
+    
+    
 } // class end

=== modified file 'local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml	2011-01-07 05:45:11 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml	2011-01-11 08:04:51 +0000
@@ -83,7 +83,7 @@
         <property name="configurationService" ref="org.hisp.dhis.config.ConfigurationService">
         </property>
     </bean>
-	<!-- DrillDown periodToOrgUnit Child/GroupMember -->
+	<!-- DrillDown periodToOrgUnit Child/GroupMember dataElements-->
 	<bean id="org.hisp.dhis.dataanalyser.ga.action.charts.GenerateDrillDownPeriodToOrgChildChartDataElementResultAction" class="org.hisp.dhis.dataanalyser.ga.action.charts.GenerateDrillDownPeriodToOrgChildChartDataElementResultAction" scope="prototype">
 		<property name="statementManager" ref="statementManager"/>
 		<property name="dashBoardService" ref="org.hisp.dhis.dataanalyser.util.DashBoardService">
@@ -97,7 +97,7 @@
 		<property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService">
 		</property>
 	</bean>
-	<!-- DrillDown OrgUnitToPeriod Child/GroupMember -->
+	<!-- DrillDown OrgUnitToPeriod Child/GroupMember dataElements -->
 	<bean id="org.hisp.dhis.dataanalyser.ga.action.charts.GenerateDrillDownOrgUnitToPeriodChartDataElementResultAction" class="org.hisp.dhis.dataanalyser.ga.action.charts.GenerateDrillDownOrgUnitToPeriodChartDataElementResultAction" scope="prototype">
 		
 		<property name="statementManager" ref="statementManager"/>
@@ -174,7 +174,31 @@
 		</property>
 		<property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService">
 		</property>
-    </bean>	
+    </bean>
+<!-- DrillDown periodToOrgUnit Child/GroupMember dataElements -->
+    <bean id="org.hisp.dhis.dataanalyser.ga.action.charts.GenerateDrillDownPeriodToOrgChildChartIndicatorResultAction" class="org.hisp.dhis.dataanalyser.ga.action.charts.GenerateDrillDownPeriodToOrgChildChartIndicatorResultAction" scope="prototype">
+        <property name="statementManager" ref="statementManager"/>
+        <property name="dashBoardService" ref="org.hisp.dhis.dataanalyser.util.DashBoardService">
+        </property>
+        <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService">
+        </property>
+        <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService">
+        </property>
+        <property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService">
+        </property>
+    </bean>
+<!-- DrillDown OrgUnitToPeriod Child/GroupMember indicator -->
+    <bean id="org.hisp.dhis.dataanalyser.ga.action.charts.GenerateDrillDownOrgUnitToPeriodChartIndicatorResultAction" class="org.hisp.dhis.dataanalyser.ga.action.charts.GenerateDrillDownOrgUnitToPeriodChartIndicatorResultAction" scope="prototype">
+        <property name="statementManager" ref="statementManager"/>
+        <property name="dashBoardService" ref="org.hisp.dhis.dataanalyser.util.DashBoardService">
+        </property>
+        <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService">
+        </property>
+        <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService">
+        </property>
+        <property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService">
+        </property>
+    </bean>
 <!-- Graphical Analyser Indicators End-->	
 	
 		

=== modified file 'local/in/dhis-web-dashboard/src/main/resources/struts.xml'
--- local/in/dhis-web-dashboard/src/main/resources/struts.xml	2011-01-07 05:45:11 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/struts.xml	2011-01-11 08:04:51 +0000
@@ -67,7 +67,7 @@
                 <param name="bufferSize">1024</param>
             </result>
         </action>
-		<!-- DrillDown periodToOrgUnit Child/GroupMember -->
+		<!-- DrillDown periodToOrgUnit Child/GroupMember dataElements -->
 		<action name="generatedrillDownPeriodToOrgChildChartDataElement" class="org.hisp.dhis.dataanalyser.ga.action.charts.GenerateDrillDownPeriodToOrgChildChartDataElementResultAction">
 			<result name="success" type="velocity">/popup.vm</result>
 			<param name="page">/dhis-web-dashboard/graphicalAnalysisDataElementResult.vm</param>
@@ -75,7 +75,7 @@
 			<param name="stylesheets">css/StylesForTags.css</param>
 			<interceptor-ref name="organisationUnitTreeStack"/>
 		</action>
-		<!-- DrillDown OrgUnitToPeriod Child/GroupMember -->
+		<!-- DrillDown OrgUnitToPeriod Child/GroupMember dataElements -->
 		<action name="generatedrillDownOurUnitToPeriodChartDataElement" class="org.hisp.dhis.dataanalyser.ga.action.charts.GenerateDrillDownOrgUnitToPeriodChartDataElementResultAction">
 			<result name="success" type="velocity">/popup.vm</result>
             <param name="page">/dhis-web-dashboard/graphicalAnalysisDataElementResult.vm</param>
@@ -128,8 +128,24 @@
                 <param name="contentDisposition">filename="${fileName}"</param>
                 <param name="bufferSize">1024</param>
             </result>
+        </action>
+<!-- DrillDown periodToOrgUnit Child/GroupMember Indicator -->
+        <action name="generateDrillDownPeriodToOrgChildChartIndicator" class="org.hisp.dhis.dataanalyser.ga.action.charts.GenerateDrillDownPeriodToOrgChildChartIndicatorResultAction">
+            <result name="success" type="velocity">/popup.vm</result>
+            <param name="page">/dhis-web-dashboard/graphicalAnalysisIndicatorResult.vm</param>
+            <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/ga.js,javascript/hashtable.js,javascript/gadataelement.js</param>
+            <param name="stylesheets">css/StylesForTags.css</param>
+            <interceptor-ref name="organisationUnitTreeStack"/>
+        </action>
+		
+<!-- DrillDown OrgUnitToPeriod Child/GroupMember Indicator -->
+        <action name="generatedrillDownOugUnitToPeriodChartIndicator" class="org.hisp.dhis.dataanalyser.ga.action.charts.GenerateDrillDownOrgUnitToPeriodChartIndicatorResultAction">
+            <result name="success" type="velocity">/popup.vm</result>
+            <param name="page">/dhis-web-dashboard/graphicalAnalysisIndicatorResult.vm</param>
+            <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/ga.js,javascript/hashtable.js,javascript/gadataelement.js</param>
+            <param name="stylesheets">css/StylesForTags.css</param>
+            <interceptor-ref name="organisationUnitTreeStack"/>
         </action>		
-		
 <!-- GraphicalAnalyser  Indicators end	-->	
 				
 		<!-- GraphicalAnalyser Module Stuff -->

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisIndicatorResult.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisIndicatorResult.vm	2010-12-29 07:47:36 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisIndicatorResult.vm	2011-01-11 08:04:51 +0000
@@ -4,7 +4,100 @@
   {
     evt.target.href = "drillDownResult.action?selectedValues="+selVal;
   }
-    
+   
+    // method called when  view by   period and group not check or group checked
+    function drillDownPeriodToOrgChildResult(evt, selDrillDownData )
+    {
+        //var aggDataCB = '$aggDataCB';
+       
+       // alert( " First method " );
+        //alert( " Period To OrgUnit View by period and Group checked or not checked " );
+        var selectedButton  = '$selectedButton';
+        
+        var viewBy = 'children';
+        
+       // alert( viewBy + ":" + selectedButton );
+       
+        //alert( selDrillDownData );
+        
+        var arugDetails = selDrillDownData.split(":");
+        var orgUnitId = arugDetails[0];
+        var orgUnitGroupId = arugDetails[1];
+        var indicatorId = arugDetails[2];
+        
+        var periodTypeName = arugDetails[3];
+        var startDate = arugDetails[4];
+        var endDate = arugDetails[5];
+        var drillDownPeriodName = arugDetails[6];
+        var aggDataCB = arugDetails[7];
+        //alert( aggDataCB );
+        
+       // alert( orgUnitId + ","  + orgUnitGroupId + "," + indicatorId + "," + periodTypeName + "," + startDate + "," + endDate + "," + drillDownPeriodName + "," + aggDataCB );
+       
+        evt.target.href = "generateDrillDownPeriodToOrgChildChartIndicator.action?selDrillDownData="+selDrillDownData + "&selectedButton=" + selectedButton + "&categoryLB=" + viewBy + "&aggDataCB=" + aggDataCB;
+    }
+     
+     // method called when  view by  children  or  random  and  Group not check , and view by children and Group checked
+    function drillDownOrgUnitToPeriodResult(evt, selDrillDownData )
+    {
+        var selectedButton  = '$selectedButton';
+        //alert( " OrgUnit To Period  view by  children or  selected and Group not checked / view by children and Group checked " );
+        
+        //alert( " Second method " );
+        var viewBy = 'period';
+        
+        //alert( viewBy + ":" + selectedButton );
+       
+        //alert( selDrillDownData );
+        
+        var arugDetails = selDrillDownData.split(":");
+        var orgUnitId = arugDetails[0];
+        var orgUnitGroupId = arugDetails[1];
+        var indicatorId = arugDetails[2];
+        
+        var periodTypeName = arugDetails[3];
+        var startDate = arugDetails[4];
+        var endDate = arugDetails[5];
+        var drillDownPeriodName = arugDetails[6];
+        var aggDataCB = arugDetails[7];
+        //alert( aggDataCB );
+        
+       // alert( orgUnitId + ","  + orgUnitGroupId + "," + indicatorId + "," + periodTypeName + "," + startDate + "," + endDate + "," + drillDownPeriodName + "," + aggDataCB );
+       
+        evt.target.href = "generatedrillDownOugUnitToPeriodChartIndicator.action?selDrillDownData="+selDrillDownData + "&selectedButton=" + selectedButton + "&categoryLB=" + viewBy + "&aggDataCB=" + aggDataCB;
+    }
+
+     // method called when  view by  selected  and Group checked
+    function drillDownOrgUnitGroupToPeriodResult(evt, selDrillDownData )
+    {
+       
+        var selectedButton  = '$selectedButton';
+        //alert( " OrgUnitGroup To Period view by  selected  and Group checked " );
+        //alert( " Third method " );
+        var viewBy = 'period';
+        
+        //alert( viewBy + ":" + selectedButton );
+       
+        //alert( selDrillDownData );
+        
+        var arugDetails = selDrillDownData.split(":");
+        var orgUnitId = arugDetails[0];
+        var orgUnitGroupId = arugDetails[1];
+        var indicatorId = arugDetails[2];
+        
+        var periodTypeName = arugDetails[3];
+        var startDate = arugDetails[4];
+        var endDate = arugDetails[5];
+        var drillDownPeriodName = arugDetails[6];
+        var aggDataCB = arugDetails[7];
+        //alert( aggDataCB );
+        
+        //alert( orgUnitId + ","  + orgUnitGroupId + "," + indicatorId + "," + periodTypeName + "," + startDate + "," + endDate + "," + drillDownPeriodName + "," + aggDataCB );
+        evt.target.href = "generatedrillDownOugUnitToPeriodChartIndicator.action?selDrillDownData="+selDrillDownData + "&selectedButton=" + selectedButton + "&categoryLB=" + viewBy + "&aggDataCB=" + aggDataCB;
+    }
+
+
+
 // Chart Display Option change start
 
   function chartTypeOptionChange(evt)
@@ -172,6 +265,7 @@
                     #end
         </tr>
          #set($count1 = 0) 
+         #set( $count4 = 0 )
          #foreach($onedataList in $indicatorChartResult.data )
       
         <tr>  
@@ -179,9 +273,11 @@
 		        #set( $denumValCimpleteResult = $indicatorChartResult.denumDataArray )
 		        #set( $numValList = $listTool.get($numValCimpleteResult, $count1) )
 		        #set( $denumValList = $listTool.get($denumValCimpleteResult, $count1) )
-		        #set( $count2 = 0 ) 	  	
+		        #set( $count2 = 0 )
+		        	  	
 		       
-		       <td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" rowspan="3">$yseriesList.get($count1).name</td> 
+		      <!-- <td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" rowspan="3">$yseriesList.get($count1).name</td>-->
+		       <td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" rowspan="3">$listTool.get( $indicatorChartResult.series, $count1 )</td>  
 		       <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Num</strong></td>
 		        #foreach($data in $onedataList) 
 		       <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$listTool.get($numValList, $count2)</td>
@@ -190,39 +286,68 @@
         </tr>
            
         <tr>           
-                  <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Den</strong></td>
-                   #set( $count2 = 0 )
-                   #foreach($data in $onedataList) 
-                    <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$listTool.get($denumValList, $count2)</td>
-                   #set( $count2 = $count2 + 1 )
-                   #end
-       </tr> 
-                
-       <tr>           
-                 <td class="TableHeadingCellStyles" align="center"  bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Val</strong></td> 
-                 #set( $count2 = 0 )
-                 #foreach($data in $onedataList) 
-                 <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1"><strong>$data</strong></td>
-                 #set( $count2 = $count2 + 1 )
-                 #end 
-                
-      </tr>  
-             #set( $count1 = $count1 + 1 )
-              
-        #end 
+              <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Den</strong></td>
+              #set( $count2 = 0 )
+              #foreach($data in $onedataList)
+                <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$listTool.get($denumValList, $count2)</td>
+              #set( $count2 = $count2 + 1 )
+              #end
+       </tr>
+                
+       <tr>
+             <td class="TableHeadingCellStyles" align="center"  bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Val</strong></td>
+             
+             #if( $categoryLB.equals( "period" ) && !$ougGroupSetCB )
+                #foreach($data in $onedataList)
+                    <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1"><strong><a href="#" onclick="javascript:drillDownPeriodToOrgChildResult( event, '$selectedDrillDownData.get($count4)' )">$data</a></strong></td>
+             #set( $count4 = $count4 + 1 )
+                #end
+             #elseif( $categoryLB.equals( "period" ) && $ougGroupSetCB )
+                #foreach($data in $onedataList)
+                    <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1"><strong><a href="#" onclick="javascript:drillDownPeriodToOrgChildResult( event, '$selectedDrillDownData.get($count4)' )">$data</a></strong></td>
+             #set( $count4 = $count4 + 1 )
+                #end 
+             #elseif( ( $categoryLB.equals( "children" ) || $categoryLB.equals( "random" )) && !$ougGroupSetCB )
+                #foreach($data in $onedataList)
+                   <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1"><strong><a href="#" onclick="javascript:drillDownOrgUnitToPeriodResult( event, '$selectedDrillDownData.get($count4)' )">$data</a></strong></td>
+             #set( $count4 = $count4 + 1 )
+                #end        
+             #elseif( $categoryLB.equals( "children" ) && $ougGroupSetCB )
+                 #foreach($data in $onedataList)
+                   <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1"><strong><a href="#" onclick="javascript:drillDownOrgUnitToPeriodResult( event, '$selectedDrillDownData.get($count4)' )">$data</a></strong></td>
+             #set( $count4 = $count4 + 1 )
+                #end        
+             #elseif( $categoryLB.equals( "random" ) && $ougGroupSetCB )
+                 #foreach($data in $onedataList)
+                   <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1"><strong><a href="#" onclick="javascript:drillDownOrgUnitGroupToPeriodResult( event, '$selectedDrillDownData.get($count4)' )">$data</a></strong></td>
+             #set( $count4 = $count4 + 1 )
+                #end        
+            
+             #else
+             #set( $count2 = 0 )
+               #foreach($data in $onedataList)
+                    <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1"><strong>$data</strong></td>
+               #set( $count2 = $count2 + 1 )
+               #end
+             #end
+             
+      </tr>
+      #set( $count1 = $count1 + 1 )
+        #end
     </table>
 </div>
 </div>   
 #if($selectedButton.equals("ViewSummary"))
-         <br><br>
+     <br><br>
      #else
-    <br>
+     <br>
          <div align="center">
              <iframe name="iframeForChart" id="iframeForChart" src="generateChart1.action?currentChart=Vertical3DBarChart" width="850px" height="550px" scrolling=auto frameborder="0"></iframe>
          </div>    
     <br>
 #end 
 </div> 
+#if( $!yseriesList && $yseriesList.size() != 0 )
    
         <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: solid" bordercolor="black" width="100%" WRAP="HARD">
               <tr>
@@ -245,7 +370,7 @@
                      #set($count1 = $count1 + 1) 
                      #end 
        </table> 
-
+#end
                        
     <textarea id="testId" rows="10" cols="70" style="display:none">&nbsp;</textarea>                                                                       
 </form>