← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4983: minor changes to charting, in preparation for completeness charts

 

------------------------------------------------------------
revno: 4983
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-10-20 11:35:23 +0200
message:
  minor changes to charting, in preparation for completeness charts
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GenerateChartAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartOptionsAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2011-09-22 09:15:51 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2011-10-20 09:35:23 +0000
@@ -34,6 +34,7 @@
 
 import org.hisp.dhis.common.AbstractIdentifiableObject;
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -49,31 +50,51 @@
     private static final long serialVersionUID = 2570074075484545534L;
 
     public static final String DIMENSION_PERIOD_INDICATOR = "period";
+
     public static final String DIMENSION_ORGANISATIONUNIT_INDICATOR = "organisationUnit";
+
     public static final String DIMENSION_INDICATOR_PERIOD = "indicator";
+
     public static final String DIMENSION_PERIOD_DATAELEMENT = "period_dataElement";
+
     public static final String DIMENSION_ORGANISATIONUNIT_DATAELEMENT = "organisationUnit_dataElement";
+
     public static final String DIMENSION_DATAELEMENT_PERIOD = "dataElement_period";
 
+    public static final String DIMENSION_PERIOD_COMPLETENESS = "period_completeness";
+
+    public static final String DIMENSION_ORGANISATIONUNIT_COMPLETENESS = "organisationUnit_completeness";
+
+    public static final String DIMENSION_COMPLETENESS_PERIOD = "completeness_period";
+
     public static final String TYPE_BAR = "bar";
+
     public static final String TYPE_BAR3D = "bar3d";
-    public static final String TYPE_STACKED_BAR = "stackedBar";    
-    public static final String TYPE_STACKED_BAR3D = "stackedBar3d";    
+
+    public static final String TYPE_STACKED_BAR = "stackedBar";
+
+    public static final String TYPE_STACKED_BAR3D = "stackedBar3d";
+
     public static final String TYPE_LINE = "line";
+
     public static final String TYPE_LINE3D = "line3d";
+
     public static final String TYPE_PIE = "pie";
+
     public static final String TYPE_PIE3D = "pie3d";
-    
+
     public static final String SIZE_NORMAL = "normal";
+
     public static final String SIZE_WIDE = "wide";
+
     public static final String SIZE_TALL = "tall";
 
     private int id;
 
     private String title;
-    
+
     private String domainAxixLabel;
-    
+
     private String rangeAxisLabel;
 
     private String type;
@@ -104,6 +125,8 @@
 
     private List<DataElement> dataElements = new ArrayList<DataElement>();
 
+    private List<DataSet> dataSets = new ArrayList<DataSet>();
+
     private List<Period> periods = new ArrayList<Period>();
 
     private List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>();
@@ -168,7 +191,7 @@
     }
 
     public void updateChartGroups( Set<ChartGroup> updates )
-    {  
+    {
         for ( ChartGroup group : new HashSet<ChartGroup>( groups ) )
         {
             if ( !updates.contains( group ) )
@@ -176,7 +199,7 @@
                 removeChartGroup( group );
             }
         }
-        
+
         for ( ChartGroup group : updates )
         {
             addChartGroup( group );
@@ -479,6 +502,16 @@
         return dataElements;
     }
 
+    public List<DataSet> getDataSets()
+    {
+        return dataSets;
+    }
+
+    public void setDataSets( List<DataSet> dataSets )
+    {
+        this.dataSets = dataSets;
+    }
+
     public List<Period> getPeriods()
     {
         return periods;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java	2011-09-22 14:26:27 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java	2011-10-20 09:35:23 +0000
@@ -33,6 +33,7 @@
 
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -54,7 +55,7 @@
     
     JFreeChart getOrganisationUnitJFreeChart( Indicator indicator, OrganisationUnit parent, boolean title, I18nFormat format );
 
-    JFreeChart getJFreeChart( List<Indicator> indicators, List<DataElement> dataElements, List<Period> periods,
+    JFreeChart getJFreeChart( List<Indicator> indicators, List<DataElement> dataElements, List<DataSet> dataSets, List<Period> periods,
         List<OrganisationUnit> organisationUnits, String dimension, boolean regression, I18nFormat format );
 
     JFreeChart getJFreeChart( String title, PlotOrientation orientation, CategoryLabelPositions labelPositions,

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2011-10-12 17:32:39 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2011-10-20 09:35:23 +0000
@@ -29,10 +29,13 @@
 
 import static org.hisp.dhis.chart.Chart.DIMENSION_DATAELEMENT_PERIOD;
 import static org.hisp.dhis.chart.Chart.DIMENSION_INDICATOR_PERIOD;
+import static org.hisp.dhis.chart.Chart.DIMENSION_COMPLETENESS_PERIOD;
 import static org.hisp.dhis.chart.Chart.DIMENSION_ORGANISATIONUNIT_DATAELEMENT;
 import static org.hisp.dhis.chart.Chart.DIMENSION_ORGANISATIONUNIT_INDICATOR;
+import static org.hisp.dhis.chart.Chart.DIMENSION_ORGANISATIONUNIT_COMPLETENESS;
 import static org.hisp.dhis.chart.Chart.DIMENSION_PERIOD_DATAELEMENT;
 import static org.hisp.dhis.chart.Chart.DIMENSION_PERIOD_INDICATOR;
+import static org.hisp.dhis.chart.Chart.DIMENSION_PERIOD_COMPLETENESS;
 import static org.hisp.dhis.chart.Chart.SIZE_NORMAL;
 import static org.hisp.dhis.chart.Chart.TYPE_BAR;
 import static org.hisp.dhis.chart.Chart.TYPE_BAR3D;
@@ -72,6 +75,7 @@
 import org.hisp.dhis.common.NameableObject;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.datavalue.DataValue;
 import org.hisp.dhis.datavalue.DataValueService;
 import org.hisp.dhis.i18n.I18nFormat;
@@ -123,7 +127,9 @@
     implements ChartService
 {
     private static final Font titleFont = new Font( "Tahoma", Font.BOLD, 15 );
+
     private static final Font subTitleFont = new Font( "Tahoma", Font.PLAIN, 12 );
+
     private static final Font labelFont = new Font( "Tahoma", Font.PLAIN, 10 );
 
     private static final String TREND_PREFIX = "Trend - ";
@@ -218,7 +224,8 @@
 
         if ( chart.getRelatives() != null )
         {
-            chart.setRelativePeriods( periodService.reloadPeriods( chart.getRelatives().getRelativePeriods( format, true ) ) );
+            chart.setRelativePeriods( periodService.reloadPeriods( chart.getRelatives().getRelativePeriods( format,
+                true ) ) );
         }
 
         User user = currentUserService.getCurrentUser();
@@ -246,7 +253,7 @@
         {
             chart.setTitle( indicator.getName() );
         }
-        
+
         chart.setType( TYPE_LINE );
         chart.setSize( SIZE_NORMAL );
         chart.setDimension( DIMENSION_PERIOD_INDICATOR );
@@ -262,7 +269,8 @@
         return getJFreeChart( chart, title );
     }
 
-    public JFreeChart getOrganisationUnitJFreeChart( Indicator indicator, OrganisationUnit parent, boolean title, I18nFormat format )
+    public JFreeChart getOrganisationUnitJFreeChart( Indicator indicator, OrganisationUnit parent, boolean title,
+        I18nFormat format )
     {
         RelativePeriods relatives = new RelativePeriods();
         relatives.setThisYear( true );
@@ -274,7 +282,7 @@
         {
             chart.setTitle( indicator.getName() );
         }
-        
+
         chart.setType( TYPE_BAR );
         chart.setSize( SIZE_NORMAL );
         chart.setDimension( DIMENSION_ORGANISATIONUNIT_INDICATOR );
@@ -289,20 +297,25 @@
 
         return getJFreeChart( chart, title );
     }
-    
-    public JFreeChart getJFreeChart( List<Indicator> indicators, List<DataElement> dataElements, List<Period> periods,
-        List<OrganisationUnit> organisationUnits, String dimension, boolean regression, I18nFormat format )
+
+    public JFreeChart getJFreeChart( List<Indicator> indicators, List<DataElement> dataElements,
+        List<DataSet> dataSets, List<Period> periods, List<OrganisationUnit> organisationUnits, String dimension,
+        boolean regression, I18nFormat format )
     {
         Chart chart = new Chart();
 
-        if ( indicators != null && indicators.size() > 0 )
+        if ( indicators != null && !indicators.isEmpty() )
         {
             chart.setTitle( getTitle( indicators.get( 0 ), periods, organisationUnits, format ) );
         }
-        else if ( dataElements != null && dataElements.size() > 0 )
+        else if ( dataElements != null && !dataElements.isEmpty() )
         {
             chart.setTitle( getTitle( dataElements.get( 0 ), periods, organisationUnits, format ) );
         }
+        else if ( dataSets != null && !dataSets.isEmpty() )
+        {
+            chart.setTitle( getTitle( dataSets.get( 0 ), periods, organisationUnits, format ) );
+        }
 
         chart.setType( TYPE_BAR );
         chart.setSize( SIZE_NORMAL );
@@ -313,6 +326,7 @@
         chart.setRegression( regression );
         chart.setIndicators( indicators );
         chart.setDataElements( dataElements );
+        chart.setDataSets( dataSets );
         chart.setPeriods( periods );
         chart.setOrganisationUnits( organisationUnits );
         chart.setFormat( format );
@@ -641,7 +655,7 @@
         CategoryPlot plot = null;
 
         CategoryDataset[] dataSets = getCategoryDataSet( chart );
-        
+
         if ( chart.isType( TYPE_LINE ) )
         {
             plot = new CategoryPlot( dataSets[0], new CategoryAxis(), new NumberAxis(), lineRenderer );
@@ -739,7 +753,7 @@
             stackedBarChart = ChartFactory.createStackedBarChart3D( chart.getTitle(), chart.getDomainAxixLabel(),
                 chart.getRangeAxisLabel(), dataSet, orientation, true, false, false );
         }
-        
+
         CategoryPlot plot = (CategoryPlot) stackedBarChart.getPlot();
         plot.setBackgroundPaint( Color.WHITE );
         plot.setOutlinePaint( Color.WHITE );
@@ -851,7 +865,7 @@
                     for ( Period period : chart.getAllPeriods() )
                     {
                         Double value = null;
-                        
+
                         if ( isIndicatorChart )
                         {
                             value = aggregationStrategy.equals( AGGREGATION_STRATEGY_REAL_TIME ) ? aggregationService
@@ -1020,7 +1034,19 @@
         {
             subTitle.setText( chart.getAllOrganisationUnits().get( 0 ).getName() );
         }
-        
+        else if ( chart.isDimension( DIMENSION_PERIOD_COMPLETENESS ) && chart.getDataSets().size() > 0 )
+        {
+            subTitle.setText( chart.getAllOrganisationUnits().get( 0 ).getName() );
+        }
+        else if ( chart.isDimension( DIMENSION_ORGANISATIONUNIT_COMPLETENESS ) && chart.getDataSets().size() > 0 )
+        {
+            subTitle.setText( format.formatPeriod( chart.getAllPeriods().get( 0 ) ) );
+        }
+        else if ( chart.isDimension( DIMENSION_COMPLETENESS_PERIOD ) && chart.getDataSets().size() > 0 )
+        {
+            subTitle.setText( chart.getAllOrganisationUnits().get( 0 ).getName() );
+        }
+
         return subTitle;
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GenerateChartAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GenerateChartAction.java	2011-06-07 16:12:23 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GenerateChartAction.java	2011-10-20 09:35:23 +0000
@@ -35,6 +35,8 @@
 import org.hisp.dhis.chart.ChartService;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorService;
@@ -79,6 +81,13 @@
         this.dataElementService = dataElementService;
     }
 
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
+
     private PeriodService periodService;
 
     public void setPeriodService( PeriodService periodService )
@@ -118,6 +127,13 @@
         this.dataElementsId = dataElementsId;
     }
 
+    private List<String> selectedDataSets = new ArrayList<String>();
+
+    public void setSelectedDataSets( List<String> selectedDataSets )
+    {
+        this.selectedDataSets = selectedDataSets;
+    }
+
     private List<String> periodId;
 
     public void setPeriodId( List<String> periodId )
@@ -199,6 +215,13 @@
             dataElements.add( dataElementService.getDataElement( id ) );
         }
 
+        List<DataSet> dataSets = new ArrayList<DataSet>();
+
+        for ( Integer id : getIntegerCollection( selectedDataSets ) )
+        {
+            dataSets.add( dataSetService.getDataSet( id ) );
+        }
+
         List<Period> periods = new ArrayList<Period>();
 
         for ( String id : periodId )
@@ -217,7 +240,7 @@
 
         height = 500;
 
-        chart = chartService.getJFreeChart( indicators, dataElements, periods, organisationUnits, dimension,
+        chart = chartService.getJFreeChart( indicators, dataElements, dataSets, periods, organisationUnits, dimension,
             regression, format );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartOptionsAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartOptionsAction.java	2011-06-14 12:47:22 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartOptionsAction.java	2011-10-20 09:35:23 +0000
@@ -39,6 +39,8 @@
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
@@ -88,6 +90,13 @@
         this.dataElementService = dataElementService;
     }
 
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
+
     private PeriodService periodService;
 
     public void setPeriodService( PeriodService periodService )
@@ -123,6 +132,13 @@
         this.dataElementComparator = dataElementComparator;
     }
 
+    private Comparator<DataSet> dataSetComparator;
+
+    public void setDataSetComparator( Comparator<DataSet> dataSetComparator )
+    {
+        this.dataSetComparator = dataSetComparator;
+    }
+
     private Comparator<OrganisationUnit> organisationUnitComparator;
 
     public void setOrganisationUnitComparator( Comparator<OrganisationUnit> organisationUnitComparator )
@@ -192,6 +208,13 @@
         return availableDataElements;
     }
 
+    private List<DataSet> availableDataSets;
+
+    public List<DataSet> getAvailableDataSets()
+    {
+        return availableDataSets;
+    }
+
     private List<Indicator> selectedIndicators;
 
     public List<Indicator> getSelectedIndicators()
@@ -206,6 +229,13 @@
         return selectedDataElements;
     }
 
+    private List<DataSet> selectedDataSets;
+
+    public List<DataSet> getSelectedDataSets()
+    {
+        return selectedDataSets;
+    }
+
     private List<PeriodType> periodTypes = new ArrayList<PeriodType>();
 
     public List<PeriodType> getPeriodTypes()
@@ -262,6 +292,8 @@
 
         availableDataElements = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
 
+        availableDataSets = new ArrayList<DataSet>( dataSetService.getAllDataSets() );
+
         periodTypes = new ArrayList<PeriodType>( periodService.getAllPeriodTypes() );
 
         availablePeriods = new MonthlyPeriodType().generatePeriods( new Date() );
@@ -275,6 +307,7 @@
         Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
         Collections.sort( availableIndicators, indicatorComparator );
         Collections.sort( availableDataElements, dataElementComparator );
+        Collections.sort( availableDataSets, dataSetComparator );
         Collections.sort( levels, new OrganisationUnitLevelComparator() );
         Collections.sort( availableOrganisationUnits, organisationUnitComparator );
 
@@ -283,6 +316,7 @@
 
         displayPropertyHandler.handle( availableIndicators );
         displayPropertyHandler.handle( availableDataElements );
+        displayPropertyHandler.handle( availableDataSets );
         displayPropertyHandler.handle( availableOrganisationUnits );
 
         if ( id != null )
@@ -295,6 +329,9 @@
             selectedDataElements = chart.getDataElements();
             availableDataElements.removeAll( selectedDataElements );
 
+            selectedDataSets = chart.getDataSets();
+            availableDataSets.removeAll( selectedDataSets );
+
             selectedPeriods = chart.getPeriods();
             availablePeriods.removeAll( selectedPeriods );
 
@@ -303,6 +340,7 @@
 
             displayPropertyHandler.handle( selectedIndicators );
             displayPropertyHandler.handle( selectedDataElements );
+            displayPropertyHandler.handle( selectedDataSets );
             displayPropertyHandler.handle( selectedOrganisationUnits );
         }
 

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java	2011-10-11 11:27:38 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java	2011-10-20 09:35:23 +0000
@@ -37,6 +37,8 @@
 import org.hisp.dhis.chart.ChartService;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -80,6 +82,13 @@
         this.dataElementService = dataElementService;
     }
 
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
+
     private PeriodService periodService;
 
     public void setPeriodService( PeriodService periodService )
@@ -113,7 +122,7 @@
     }
 
     private String rangeAxisLabel;
-    
+
     public void setRangeAxisLabel( String rangeAxisLabel )
     {
         this.rangeAxisLabel = rangeAxisLabel;
@@ -238,6 +247,13 @@
         this.selectedOrganisationUnits = selectedOrganisationUnits;
     }
 
+    private List<String> selectedDataSets = new ArrayList<String>();
+
+    public void setSelectedDataSets( List<String> selectedDataSets )
+    {
+        this.selectedDataSets = selectedDataSets;
+    }
+
     private boolean reportingMonth;
 
     public void setReportingMonth( boolean reportingMonth )
@@ -246,12 +262,12 @@
     }
 
     private boolean reportingBimonth;
-    
+
     public void setReportingBimonth( boolean reportingBimonth )
     {
         this.reportingBimonth = reportingBimonth;
     }
-    
+
     private boolean reportingQuarter;
 
     public void setReportingQuarter( boolean reportingQuarter )
@@ -312,6 +328,7 @@
         List<Indicator> indicators = new ArrayList<Indicator>();
         List<DataElement> dataElements = new ArrayList<DataElement>();
         List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>();
+        List<DataSet> dataSets = new ArrayList<DataSet>();
         List<Period> periods = new ArrayList<Period>( periodService.getPeriodsByExternalIds( selectedPeriods ) );
 
         for ( Integer id : getIntegerCollection( selectedIndicators ) )
@@ -329,6 +346,11 @@
             organisationUnits.add( organisationUnitService.getOrganisationUnit( id ) );
         }
 
+        for ( Integer id : getIntegerCollection( selectedDataSets ) )
+        {
+            dataSets.add( dataSetService.getDataSet( id ) );
+        }
+
         Collections.sort( periods, new AscendingPeriodComparator() );
 
         chart.setTitle( title );
@@ -348,12 +370,12 @@
         chart.setUserOrganisationUnit( userOrganisationUnit );
         chart.setIndicators( indicators );
         chart.setDataElements( dataElements );
+        chart.setDataSets( dataSets );
         chart.setPeriods( periods );
         chart.setOrganisationUnits( organisationUnits );
 
         RelativePeriods relatives = new RelativePeriods( reportingMonth, reportingBimonth, reportingQuarter,
-            monthsThisYear, quartersThisYear, thisYear,
-            monthsLastYear, quartersLastYear, lastYear, false );
+            monthsThisYear, quartersThisYear, thisYear, monthsLastYear, quartersLastYear, lastYear, false );
 
         chart.setRelatives( relatives );
 

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml	2011-09-16 16:54:03 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml	2011-10-20 09:35:23 +0000
@@ -48,6 +48,7 @@
     <property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
     <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
     <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
     <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
     <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
   </bean>
@@ -72,6 +73,7 @@
     <property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
     <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
     <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
     <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
     <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
   </bean>
@@ -86,6 +88,7 @@
     <property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
     <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
     <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
     <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
     <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
   </bean>