← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5138: (GIS) Points and polygons at the same level no longer break map rendering + (DV) Visualizer plugi...

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 5138 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-11-10 21:19:28 +0000
message:
  (GIS) Points and polygons at the same level no longer break map rendering + (DV) Visualizer plugin - work in progress.
added:
  dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedDataValuesPluginAction.java
  dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedIndicatorValuesPluginAction.java
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/plugin.css
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.html
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.js
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedDataValuesPlugin.vm
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedIndicatorValuesPlugin.vm
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
  dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/DeleteMapLegendAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportExcelAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportImageAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllIndicatorsAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetMapLegendSetsByTypeAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitsAtLevelAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedDataValues.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 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java	2011-10-20 20:54:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java	2011-11-10 20:57:29 +0000
@@ -32,6 +32,7 @@
 import java.util.Set;
 
 import org.hisp.dhis.aggregation.AggregatedMapValue;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.period.Period;
 
 /**
@@ -71,6 +72,14 @@
     final String MAP_LAYER_TYPE_OVERLAY = "overlay";
 
     // -------------------------------------------------------------------------
+    // Organisation units
+    // -------------------------------------------------------------------------    
+    
+    boolean isPointMinority( Collection<OrganisationUnit> organisationUnits );
+    
+    Collection<OrganisationUnit> removeMinorityFeatureType( Collection<OrganisationUnit> object );
+
+    // -------------------------------------------------------------------------
     // IndicatorMapValue
     // -------------------------------------------------------------------------
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2011-09-11 14:24:44 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2011-11-10 20:57:29 +0000
@@ -440,6 +440,16 @@
 
         return set;
     }
+    
+    public boolean isPolygon()
+    {
+        return ( featureType.equals( FEATURETYPE_MULTIPOLYGON ) || featureType.equals( FEATURETYPE_POLYGON ) );
+    }
+    
+    public boolean isPoint()
+    {
+        return featureType.equals( FEATURETYPE_POINT );
+    }
 
     // -------------------------------------------------------------------------
     // hashCode, equals and toString

=== modified file 'dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java'
--- dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java	2011-10-20 20:54:17 +0000
+++ dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java	2011-11-10 20:57:29 +0000
@@ -27,6 +27,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.options.SystemSettingManager.AGGREGATION_STRATEGY_BATCH;
+import static org.hisp.dhis.options.SystemSettingManager.AGGREGATION_STRATEGY_REAL_TIME;
+import static org.hisp.dhis.options.SystemSettingManager.DEFAULT_AGGREGATION_STRATEGY;
+import static org.hisp.dhis.options.SystemSettingManager.KEY_AGGREGATION_STRATEGY;
+
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashSet;
@@ -56,8 +62,6 @@
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.Assert;
 
-import static org.hisp.dhis.options.SystemSettingManager.*;
-
 /**
  * @author Jan Henrik Overland
  * @version $Id$
@@ -169,8 +173,8 @@
 
         if ( parentOrganisationUnitId != null && level != null )
         {
-            organisationUnits = organisationUnitService.getOrganisationUnitsAtLevel( level, organisationUnitService
-                .getOrganisationUnit( parentOrganisationUnitId ) );
+            organisationUnits = organisationUnitService.getOrganisationUnitsAtLevel( level,
+                organisationUnitService.getOrganisationUnit( parentOrganisationUnitId ) );
         }
         else if ( level != null )
         {
@@ -184,6 +188,52 @@
         return organisationUnits;
     }
 
+    public boolean isPointMinority( Collection<OrganisationUnit> object )
+    {
+        int polygons = 0, points = 0;
+
+        for ( OrganisationUnit unit : object )
+        {
+            polygons = unit.isPolygon() ? polygons + 1 : polygons;
+
+            points = unit.isPoint() ? points + 1 : points;
+        }
+
+        return polygons > points ? true : false;
+    }
+
+    public Collection<OrganisationUnit> removeMinorityFeatureType( Collection<OrganisationUnit> object )
+    {
+        boolean isPointMinority = isPointMinority( object );
+
+        Collection<OrganisationUnit> majority = new ArrayList<OrganisationUnit>();
+
+        if ( isPointMinority )
+        {
+            for ( OrganisationUnit unit : object )
+            {
+                if ( unit.getFeatureType().equals( OrganisationUnit.FEATURETYPE_MULTIPOLYGON )
+                    || unit.getFeatureType().equals( OrganisationUnit.FEATURETYPE_POLYGON ) )
+                {
+                    majority.add( unit );
+                }
+            }
+        }
+
+        else
+        {
+            for ( OrganisationUnit unit : object )
+            {
+                if ( unit.getFeatureType().equals( OrganisationUnit.FEATURETYPE_POINT ) )
+                {
+                    majority.add( unit );
+                }
+            }
+        }
+
+        return majority;
+    }
+
     // -------------------------------------------------------------------------
     // IndicatorMapValues
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/DeleteMapLegendAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/DeleteMapLegendAction.java	2010-03-25 15:27:40 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/DeleteMapLegendAction.java	2011-11-10 20:57:29 +0000
@@ -1,9 +1,10 @@
 package org.hisp.dhis.mapping.action;
 
-import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.mapping.MapLegend;
 import org.hisp.dhis.mapping.MappingService;
 
+import com.opensymphony.xwork2.Action;
+
 public class DeleteMapLegendAction
     implements Action
 {

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportExcelAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportExcelAction.java	2011-09-23 18:54:49 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportExcelAction.java	2011-11-10 20:57:29 +0000
@@ -29,8 +29,6 @@
 
 import java.io.OutputStream;
 
-import javax.servlet.http.HttpServletResponse;
-
 import jxl.CellView;
 import jxl.Workbook;
 import jxl.format.Alignment;
@@ -59,6 +57,8 @@
 import org.hisp.dhis.util.ContextUtils;
 import org.hisp.dhis.util.StreamActionSupport;
 
+import javax.servlet.http.HttpServletResponse;
+
 /**
  * @author Tran Thanh Tri
  * @version $Id$

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportImageAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportImageAction.java	2011-09-23 18:54:49 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportImageAction.java	2011-11-10 20:57:29 +0000
@@ -29,8 +29,6 @@
 
 import java.io.OutputStream;
 
-import javax.servlet.http.HttpServletResponse;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.mapping.export.SVGDocument;
@@ -39,6 +37,8 @@
 import org.hisp.dhis.util.SessionUtils;
 import org.hisp.dhis.util.StreamActionSupport;
 
+import javax.servlet.http.HttpServletResponse;
+
 /**
  * @author Tran Thanh Tri
  * @version $Id$

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllIndicatorsAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllIndicatorsAction.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllIndicatorsAction.java	2011-11-10 20:57:29 +0000
@@ -28,6 +28,7 @@
  */
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 
@@ -37,8 +38,6 @@
 
 import com.opensymphony.xwork2.Action;
 
-import java.util.Collections;
-
 /**
  * @author Jan Henrik Overland
  * @version $Id$

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonAction.java	2011-10-28 15:43:36 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonAction.java	2011-11-10 20:57:29 +0000
@@ -29,6 +29,7 @@
 
 import java.util.Collection;
 
+import org.hisp.dhis.mapping.MappingService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
@@ -64,6 +65,13 @@
     {
         this.organisationUnitGroupService = organisationUnitGroupService;
     }
+    
+    private MappingService mappingService;
+
+    public void setMappingService( MappingService mappingService )
+    {
+        this.mappingService = mappingService;
+    }
 
     // -------------------------------------------------------------------------
     // Input
@@ -108,6 +116,8 @@
         object = organisationUnitService.getOrganisationUnitsAtLevel( level, parent );
 
         FilterUtils.filter( object, new OrganisationUnitWithCoordinatesFilter() );
+        
+        object = mappingService.removeMinorityFeatureType( object );        
 
         String returnType = object.size() > 0 ? object.iterator().next().getFeatureType() : NONE;
 

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetMapLegendSetsByTypeAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetMapLegendSetsByTypeAction.java	2011-07-13 21:01:29 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetMapLegendSetsByTypeAction.java	2011-11-10 20:57:29 +0000
@@ -27,13 +27,15 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.opensymphony.xwork2.Action;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+
 import org.hisp.dhis.mapping.MapLegendSet;
 import org.hisp.dhis.mapping.MappingService;
 
+import com.opensymphony.xwork2.Action;
+
 /**
  * @author Jan Henrik Overland
  * @version $Id$

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitsAtLevelAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitsAtLevelAction.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitsAtLevelAction.java	2011-11-10 20:57:29 +0000
@@ -28,6 +28,7 @@
  */
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 
@@ -37,8 +38,6 @@
 
 import com.opensymphony.xwork2.Action;
 
-import java.util.Collections;
-
 /**
  * @author Lars Helge Overland
  * @version $Id$

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml	2011-08-20 10:36:26 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml	2011-11-10 20:57:29 +0000
@@ -304,6 +304,8 @@
             ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
         <property name="organisationUnitGroupService"
             ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
+        <property name="mappingService"
+            ref="org.hisp.dhis.mapping.MappingService" />
     </bean>
 
     <bean id="org.hisp.dhis.mapping.action.GetGeoJsonByParentAction"

=== added file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedDataValuesPluginAction.java'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedDataValuesPluginAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedDataValuesPluginAction.java	2011-11-08 12:44:02 +0000
@@ -0,0 +1,226 @@
+package org.hisp.dhis.visualizer.action;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.hisp.dhis.aggregation.AggregatedDataValue;
+import org.hisp.dhis.aggregation.AggregatedDataValueService;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.i18n.I18nFormat;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.RelativePeriods;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Jan Henrik Overland
+ */
+public class GetAggregatedDataValuesPluginAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private AggregatedDataValueService aggregatedDataValueService;
+
+    public void setAggregatedDataValueService( AggregatedDataValueService aggregatedDataValueService )
+    {
+        this.aggregatedDataValueService = aggregatedDataValueService;
+    }
+
+    private DataElementService dataElementService;
+
+    public void setDataElementService( DataElementService dataElementService )
+    {
+        this.dataElementService = dataElementService;
+    }
+
+    private PeriodService periodService;
+
+    public void setPeriodService( PeriodService periodService )
+    {
+        this.periodService = periodService;
+    }
+
+    private OrganisationUnitService organisationUnitService;
+
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
+    private I18nFormat format;
+
+    public void setFormat( I18nFormat format )
+    {
+        this.format = format;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input
+    // -------------------------------------------------------------------------
+
+    private Collection<Integer> dataElementIds;
+
+    public void setDataElementIds( Collection<Integer> dataElementIds )
+    {
+        this.dataElementIds = dataElementIds;
+    }
+
+    private Collection<Integer> organisationUnitIds;
+
+    public void setOrganisationUnitIds( Collection<Integer> organisationUnitIds )
+    {
+        this.organisationUnitIds = organisationUnitIds;
+    }
+    
+    private Boolean lastMonth;
+
+    public void setLastMonth( Boolean lastMonth )
+    {
+        this.lastMonth = lastMonth;
+    }
+    
+    private Boolean monthsThisYear;
+
+    public void setMonthsThisYear( Boolean monthsThisYear )
+    {
+        this.monthsThisYear = monthsThisYear;
+    }
+    
+    private Boolean monthsLastYear;
+
+    public void setMonthsLastYear( Boolean monthsLastYear )
+    {
+        this.monthsLastYear = monthsLastYear;
+    }
+    
+    private Boolean lastQuarter;
+
+    public void setLastQuarter( Boolean lastQuarter )
+    {
+        this.lastQuarter = lastQuarter;
+    }
+    
+    private Boolean quartersThisYear;
+
+    public void setQuartersThisYear( Boolean quartersThisYear )
+    {
+        this.quartersThisYear = quartersThisYear;
+    }
+    
+    private Boolean quartersLastYear;
+
+    public void setQuartersLastYear( Boolean quartersLastYear )
+    {
+        this.quartersLastYear = quartersLastYear;
+    }
+    
+    private Boolean thisYear;
+
+    public void setThisYear( Boolean thisYear )
+    {
+        this.thisYear = thisYear;
+    }
+    
+    private Boolean lastYear;
+
+    public void setLastYear( Boolean lastYear )
+    {
+        this.lastYear = lastYear;
+    }
+    
+    private Boolean lastFiveYears;
+
+    public void setLastFiveYears( Boolean lastFiveYears )
+    {
+        this.lastFiveYears = lastFiveYears;
+    }
+
+    // -------------------------------------------------------------------------
+    // Output
+    // -------------------------------------------------------------------------
+
+    private Collection<AggregatedDataValue> object;
+
+    public Collection<AggregatedDataValue> getObject()
+    {
+        return object;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {
+        if ( dataElementIds != null && organisationUnitIds != null &&
+            ( lastMonth || monthsThisYear || monthsLastYear || lastQuarter || quartersThisYear ||
+                quartersLastYear || thisYear || lastYear || lastFiveYears ) )
+        {
+            RelativePeriods rp = new RelativePeriods();
+            rp.setReportingMonth( lastMonth );
+            rp.setMonthsThisYear( monthsThisYear );
+            rp.setMonthsLastYear( monthsLastYear );
+            rp.setReportingQuarter( lastQuarter );
+            rp.setQuartersThisYear( quartersThisYear );
+            rp.setQuartersLastYear( quartersLastYear );
+            rp.setThisYear( thisYear );
+            rp.setLastYear( lastYear );
+            rp.setLast5Years( lastFiveYears );
+            
+            Collection<Period> periods = rp.getRelativePeriods();
+            
+            Collection<Integer> periodIds = new ArrayList<Integer>();
+            
+            for ( Period period : periods )
+            {
+                periodIds.add( period.getId() );
+            }
+            
+            object = aggregatedDataValueService.getAggregatedDataValues( dataElementIds, periodIds,
+                organisationUnitIds );
+
+            for ( AggregatedDataValue value : object )
+            {
+                value.setDataElementName( dataElementService.getDataElement( value.getDataElementId() ).getName() );
+                value.setPeriodName( format.formatPeriod( periodService.getPeriod( value.getPeriodId() ) ) );
+                value.setOrganisationUnitName( organisationUnitService.getOrganisationUnit(
+                    value.getOrganisationUnitId() ).getName() );
+            }
+        }
+
+        return SUCCESS;
+    }
+}

=== added file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedIndicatorValuesPluginAction.java'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedIndicatorValuesPluginAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedIndicatorValuesPluginAction.java	2011-11-10 20:57:29 +0000
@@ -0,0 +1,227 @@
+package org.hisp.dhis.visualizer.action;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.hisp.dhis.aggregation.AggregatedDataValueService;
+import org.hisp.dhis.aggregation.AggregatedIndicatorValue;
+import org.hisp.dhis.i18n.I18nFormat;
+import org.hisp.dhis.indicator.IndicatorService;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.RelativePeriods;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Jan Henrik Overland
+ */
+public class GetAggregatedIndicatorValuesPluginAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private AggregatedDataValueService aggregatedDataValueService;
+
+    public void setAggregatedDataValueService( AggregatedDataValueService aggregatedDataValueService )
+    {
+        this.aggregatedDataValueService = aggregatedDataValueService;
+    }
+
+    private IndicatorService indicatorService;
+
+    public void setIndicatorService( IndicatorService indicatorService )
+    {
+        this.indicatorService = indicatorService;
+    }
+
+    private PeriodService periodService;
+
+    public void setPeriodService( PeriodService periodService )
+    {
+        this.periodService = periodService;
+    }
+
+    private OrganisationUnitService organisationUnitService;
+
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
+    private I18nFormat format;
+
+    public void setFormat( I18nFormat format )
+    {
+        this.format = format;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input
+    // -------------------------------------------------------------------------
+
+    private Collection<Integer> indicatorIds;
+
+    public void setIndicatorIds( Collection<Integer> indicatorIds )
+    {
+        this.indicatorIds = indicatorIds;
+    }
+
+    private Collection<Integer> organisationUnitIds;
+
+    public void setOrganisationUnitIds( Collection<Integer> organisationUnitIds )
+    {
+        this.organisationUnitIds = organisationUnitIds;
+    }
+
+    private boolean lastMonth;
+
+    public void setLastMonth( boolean lastMonth )
+    {
+        this.lastMonth = lastMonth;
+    }
+
+    private boolean monthsThisYear;
+
+    public void setMonthsThisYear( boolean monthsThisYear )
+    {
+        this.monthsThisYear = monthsThisYear;
+    }
+
+    private boolean monthsLastYear;
+
+    public void setMonthsLastYear( boolean monthsLastYear )
+    {
+        this.monthsLastYear = monthsLastYear;
+    }
+
+    private boolean lastQuarter;
+
+    public void setLastQuarter( boolean lastQuarter )
+    {
+        this.lastQuarter = lastQuarter;
+    }
+
+    private boolean quartersThisYear;
+
+    public void setQuartersThisYear( boolean quartersThisYear )
+    {
+        this.quartersThisYear = quartersThisYear;
+    }
+
+    private boolean quartersLastYear;
+
+    public void setQuartersLastYear( boolean quartersLastYear )
+    {
+        this.quartersLastYear = quartersLastYear;
+    }
+
+    private boolean thisYear;
+
+    public void setThisYear( boolean thisYear )
+    {
+        this.thisYear = thisYear;
+    }
+
+    private boolean lastYear;
+
+    public void setLastYear( boolean lastYear )
+    {
+        this.lastYear = lastYear;
+    }
+
+    private boolean lastFiveYears;
+
+    public void setLastFiveYears( boolean lastFiveYears )
+    {
+        this.lastFiveYears = lastFiveYears;
+    }
+
+    // -------------------------------------------------------------------------
+    // Output
+    // -------------------------------------------------------------------------
+
+    private Collection<AggregatedIndicatorValue> object;
+
+    public Collection<AggregatedIndicatorValue> getObject()
+    {
+        return object;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {
+        if ( indicatorIds != null
+            && organisationUnitIds != null
+            && (lastMonth || monthsThisYear || monthsLastYear || lastQuarter || quartersThisYear || quartersLastYear
+                || thisYear || lastYear || lastFiveYears) )
+        {
+            RelativePeriods rp = new RelativePeriods();
+            rp.setReportingMonth( lastMonth );
+            rp.setMonthsThisYear( monthsThisYear );
+            rp.setMonthsLastYear( monthsLastYear );
+            rp.setReportingQuarter( lastQuarter );
+            rp.setQuartersThisYear( quartersThisYear );
+            rp.setQuartersLastYear( quartersLastYear );
+            rp.setThisYear( thisYear );
+            rp.setLastYear( lastYear );
+            rp.setLast5Years( lastFiveYears );
+
+            Collection<Period> periods = periodService.reloadPeriods( rp.getRelativePeriods() );
+
+            Collection<Integer> periodIds = new ArrayList<Integer>();
+
+            for ( Period period : periods )
+            {
+                periodIds.add( period.getId() );
+            }
+
+            object = aggregatedDataValueService.getAggregatedIndicatorValues( indicatorIds, periodIds,
+                organisationUnitIds );
+
+            for ( AggregatedIndicatorValue value : object )
+            {
+                value.setIndicatorName( indicatorService.getIndicator( value.getIndicatorId() ).getName() );
+                value.setPeriodName( format.formatPeriod( periodService.getPeriod( value.getPeriodId() ) ) );
+                value.setOrganisationUnitName( organisationUnitService.getOrganisationUnit(
+                    value.getOrganisationUnitId() ).getName() );
+            }
+        }
+
+        return SUCCESS;
+    }
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/META-INF/dhis/beans.xml	2011-10-27 12:35:27 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/META-INF/dhis/beans.xml	2011-11-08 15:53:59 +0000
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans";
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+<beans xmlns="http://www.springframework.org/schema/beans";
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 	xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd";>
-	
-	<!-- No -->
-	
-	<bean id="org.hisp.dhis.visualizer.action.NoAction"
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd";>
+	
+	<!-- No -->
+	
+	<bean id="org.hisp.dhis.visualizer.action.NoAction"
 		class="org.hisp.dhis.visualizer.action.NoAction" scope="prototype" />
     
     <!-- Initialize -->
@@ -35,6 +35,17 @@
 		<property name="aggregatedDataValueService"
 			ref="org.hisp.dhis.aggregation.AggregatedDataValueService" />
 	</bean>
+
+	<bean id="org.hisp.dhis.visualizer.action.GetAggregatedIndicatorValuesPluginAction"
+		class="org.hisp.dhis.visualizer.action.GetAggregatedIndicatorValuesPluginAction"
+		scope="prototype">
+		<property name="aggregatedDataValueService"
+			ref="org.hisp.dhis.aggregation.AggregatedDataValueService" />
+		<property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
+		<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+		<property name="organisationUnitService"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+	</bean>
     
     <!-- AggregatedDataValue -->
 
@@ -43,6 +54,17 @@
         scope="prototype">
         <property name="aggregatedDataValueService"
             ref="org.hisp.dhis.aggregation.AggregatedDataValueService" />
-    </bean>
-	
+    </bean>
+
+	<bean id="org.hisp.dhis.visualizer.action.GetAggregatedDataValuesPluginAction"
+		class="org.hisp.dhis.visualizer.action.GetAggregatedDataValuesPluginAction"
+		scope="prototype">
+		<property name="aggregatedDataValueService"
+			ref="org.hisp.dhis.aggregation.AggregatedDataValueService" />
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+		<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+		<property name="organisationUnitService"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+	</bean>
+	
 </beans>

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/struts.xml	2011-10-27 12:35:27 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/struts.xml	2011-11-08 15:53:59 +0000
@@ -39,6 +39,12 @@
                 /dhis-web-visualizer/jsonminAggregatedIndicatorValues.vm</result>
         </action>
 
+        <action name="getAggregatedIndicatorValuesPlugin"
+            class="org.hisp.dhis.visualizer.action.GetAggregatedIndicatorValuesPluginAction">
+            <result name="success" type="velocity-json">
+                /dhis-web-visualizer/jsonminAggregatedIndicatorValuesPlugin.vm</result>
+        </action>
+
         <!-- AggregatedDataValue -->
 
         <action name="getAggregatedDataValues"
@@ -48,6 +54,12 @@
             <result name="none" type="velocity-json">
                 /dhis-web-visualizer/void.vm</result>
         </action>
+
+        <action name="getAggregatedDataValuesPlugin"
+            class="org.hisp.dhis.visualizer.action.GetAggregatedDataValuesPluginAction">
+            <result name="success" type="velocity-json">
+                /dhis-web-visualizer/jsonminAggregatedDataValuesPlugin.vm</result>
+        </action>
 		
 	</package>
 </struts>

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js	2011-11-04 20:04:30 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js	2011-11-08 12:44:02 +0000
@@ -47,20 +47,11 @@
             pie: 'pie'
         }
     },
-    css: {
+    style: {
         label: {
             period_group: 'font:bold 11px arial; color:#444; line-height:20px'
         }
     },
-	chart: {
-		axis: {
-			label: {
-				rotate: {
-					degrees: 330
-				}
-			}
-		}
-	},
     layout: {
         west_cmp_width: 380,
         west_width: 424,
@@ -95,13 +86,10 @@
         
         DV.chart.data = DV.conf.init.data;
         
-        DV.exe.start(true);
+        DV.exe.execute(true, DV.init.isInit);
     };
     
     DV.cmp = {
-		west: null,
-		center: null,
-		east: null,
         charttype: [],
         dimension: {
             period: []
@@ -115,12 +103,12 @@
         },
         viewport: {
             getSize: function() {
-                var p = DV.cmp.center;
-                return {x: p.getWidth(), y: p.getHeight()};
+                var c = Ext.getCmp('center');
+                return {x: c.getWidth(), y: c.getHeight()};
             },
             getXY: function() {
-                var p = DV.cmp.center;
-                return {x: p.x + 15, y: p.y + 43};
+                var c = Ext.getCmp('center');
+                return {x: c.x + 15, y: c.y + 43};
             }
         },
         multiselect: {
@@ -345,8 +333,7 @@
             getEncodedSeriesName: function(text) {
                 return text.replace(/\./g,'');
             },
-            getLegend: function() {
-				var len = DV.state.series.data.length;
+            getLegend: function(len) {
                 return {
                     position: len > 6 ? 'right' : 'top',
                     boxStroke: '#ffffff',
@@ -627,7 +614,7 @@
             this.series.dimension = this.series.cmp.getValue();
             this.category.dimension = this.category.cmp.getValue();
             this.filter.dimension = this.filter.cmp.getValue();
-            
+                        
             var i = this.getIndiment().value,
                 p = DV.conf.finals.dimension.period.value,
                 o = DV.conf.finals.dimension.organisationunit.value;
@@ -767,8 +754,7 @@
                 height: DV.util.viewport.getSize().y,
                 animate: true,
                 store: DV.store.chart,
-                legend: DV.util.chart.getLegend(),
-				style: 'padding-top:50px: background-color:red',
+                legend: DV.util.chart.getLegend(DV.state.series.data.length),
                 axes: [
                     {
                         title: 'Value',
@@ -787,8 +773,7 @@
                         title: DV.init.isInit ? 'Categories' : DV.conf.finals.dimension[DV.state.category.dimension].rawvalue,
                         type: 'Category',
                         position: 'bottom',
-                        fields: DV.store.chart.bottom,
-						label: DV.conf.chart.axis.label
+                        fields: DV.store.chart.bottom
                     }
                 ],
                 series: [
@@ -814,7 +799,7 @@
                 height: DV.util.viewport.getSize().y,
                 animate: true,
                 store: DV.store.chart,
-                legend: DV.util.chart.getLegend(),
+                legend: DV.util.chart.getLegend(DV.state.series.data.length),
                 axes: [
                     {
                         title: DV.conf.finals.dimension[DV.state.category.dimension].rawvalue,
@@ -859,7 +844,7 @@
                 height: DV.util.viewport.getSize().y,
                 animate: true,
                 store: DV.store.chart,
-                legend: DV.util.chart.getLegend(),
+                legend: DV.util.chart.getLegend(DV.state.series.data.length),
                 axes: [
                     {
                         title: 'Value',
@@ -878,8 +863,7 @@
                         title: DV.conf.finals.dimension[DV.state.category.dimension].rawvalue,
                         type: 'Category',
                         position: 'bottom',
-                        fields: DV.store.chart.bottom,
-						label: DV.conf.chart.axis.label
+                        fields: DV.store.chart.bottom
                     }
                 ],
                 series: DV.util.chart.line.getSeriesArray()
@@ -891,7 +875,7 @@
                 height: DV.util.viewport.getSize().y,
                 animate: true,
                 store: DV.store.chart,
-                legend: DV.util.chart.getLegend(),
+                legend: DV.util.chart.getLegend(DV.state.series.data.length),
                 axes: [
                     {
                         title: 'Value',
@@ -910,8 +894,7 @@
                         title: DV.conf.finals.dimension[DV.state.category.dimension].rawvalue,
                         type: 'Category',
                         position: 'bottom',
-                        fields: DV.store.chart.bottom,
-						label: DV.conf.chart.axis.label
+                        fields: DV.store.chart.bottom
                     }
                 ],
                 series: [{
@@ -932,7 +915,7 @@
                 animate: true,
                 shadow: true,
                 store: DV.store.chart,
-                legend: DV.util.chart.getLegend(),
+                legend: DV.util.chart.getLegend(DV.state.category.data.length),
                 insetPadding: 60,
                 series: [{
                     type: 'pie',
@@ -961,10 +944,10 @@
             });
         },
         reload: function() {
-            var p = DV.cmp.center;
-            p.removeAll(true);
-            p.add(this.chart);
-            p.down('label').setText(DV.state.filter.data[0] || 'Example chart');
+            var c = Ext.getCmp('center');
+            c.removeAll(true);
+            c.add(this.chart);
+            c.down('label').setText(DV.state.filter.data[0] || 'Example chart');
             
             if (!DV.init.isInit) {
                 DV.store.getDataTableStore(true);
@@ -1020,15 +1003,15 @@
             }
         },
         reload: function() {
-            var p = DV.cmp.east;
-            p.removeAll(true);
-            p.add(this.datatable);
+            var c = DV.util.getCmp('panel[region="east"]');
+            c.removeAll(true);
+            c.add(this.datatable);
         }            
     };
     
     DV.exe = {
-        start: function(exe) {
-            if (DV.init.isInit) {
+        execute: function(exe, init) {
+            if (init) {
                 DV.store.getChartStore(exe);
             }
             else {
@@ -1046,10 +1029,11 @@
         items: [
             {
                 region: 'west',
-				width: DV.conf.layout.west_width,
                 preventHeader: true,
                 collapsible: true,
                 collapseMode: 'mini',
+                resizable: true,
+                resizeHandles: 'e',
                 items: [
                     {
                         xtype: 'toolbar',
@@ -1576,7 +1560,7 @@
                                                     {
                                                         xtype: 'label',
                                                         text: 'Months',
-                                                        style: DV.conf.css.label.period_group
+                                                        style: DV.conf.style.label.period_group
                                                     },
                                                     {
                                                         xtype: 'checkbox',
@@ -1614,7 +1598,7 @@
                                                     {
                                                         xtype: 'label',
                                                         text: 'Quarters',
-                                                        style: DV.conf.css.label.period_group
+                                                        style: DV.conf.style.label.period_group
                                                     },
                                                     {
                                                         xtype: 'checkbox',
@@ -1651,7 +1635,7 @@
                                                     {
                                                         xtype: 'label',
                                                         text: 'Years',
-                                                        style: DV.conf.css.label.period_group
+                                                        style: DV.conf.style.label.period_group
                                                     },
                                                     {
                                                         xtype: 'checkbox',
@@ -1758,15 +1742,12 @@
                     }
                 ],
                 listeners: {
-					afterrender: function() {
-						DV.cmp.west = this;
-					},
-                    collapse: function() {                    
-                        this.collapsed = true;
+                    collapse: function(p) {                    
+                        p.collapsed = true;
                         DV.util.getCmp('button[name="resizeleft"]').setText('<span style="font-weight:bold">>>></span>');
                     },
-                    expand: function() {
-                        this.collapsed = false;
+                    expand: function(p) {
+                        p.collapsed = false;
                         DV.util.getCmp('button[name="resizeleft"]').setText('<span style="font-weight:bold"><<<</span>');
                     }
                 }
@@ -1783,7 +1764,7 @@
                         text: '<span style="font-weight:bold"><<<</span>',
                         tooltip: 'Show/hide chart settings',
                         handler: function() {
-                            var p = DV.cmp.west;
+                            var p = DV.util.getCmp('panel[region="west"]');
                             if (p.collapsed) {
                                 p.expand();
                             }
@@ -1799,7 +1780,7 @@
                         cls: 'x-btn-text-icon',
                         icon: 'images/refresh.png',
                         handler: function() {
-                            DV.exe.start(true);
+                            DV.exe.execute(true, DV.init.isInit);
                         }
                     },
                     {
@@ -1809,7 +1790,7 @@
                         cls: 'x-btn-text-icon',
                         icon: 'images/datatable.png',
                         handler: function(b) {
-                            var p = DV.cmp.east;
+                            var p = DV.util.getCmp('panel[region="east"]');
                             if (p.collapsed && p.items.length) {
                                 p.expand();
                                 DV.exe.datatable(true);
@@ -1836,12 +1817,7 @@
                         }
                     }
                     
-                ],
-				listeners: {
-					afterrender: function() {
-						DV.cmp.center = this;
-					}
-				}
+                ]
             },
             {
                 region: 'east',
@@ -1849,6 +1825,8 @@
                 collapsible: true,
                 collapsed: true,
                 collapseMode: 'mini',
+                resizable: true,
+                resizeHandles: 'w',
                 width: 498,
                 tbar: {
                     height: DV.conf.layout.east_tbar_height,
@@ -1860,12 +1838,7 @@
                             style: 'font-weight:bold; padding:0 4px'
                         }
                     ]
-                },
-				listeners: {
-					afterrender: function() {
-						DV.cmp.east = this;
-					}
-				}
+                }
             }
         ],
         listeners: {
@@ -1873,6 +1846,8 @@
                 DV.init.initialize(vp);
             },
             resize: function(vp) {
+                vp.query('panel[region="west"]')[0].setWidth(DV.conf.layout.west_width);
+                
                 if (DV.cmp.datatable) {
                     DV.cmp.datatable.setHeight(DV.util.viewport.getSize().y - DV.conf.layout.east_tbar_height);
                 }

=== added file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/plugin.css'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/plugin.css	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/plugin.css	2011-11-10 20:57:29 +0000
@@ -0,0 +1,9 @@
+body {
+	margin: 100px;
+}
+
+#bar_chart_1 {
+	height: 400px;
+	width: 600px;
+	border: 1px solid #ccc;
+}

=== added directory 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin'
=== added file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.html'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.html	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.html	2011-11-10 20:57:29 +0000
@@ -0,0 +1,29 @@
+<html>
+<head>
+    <link rel="stylesheet" type="text/css" href="../lib/ext/resources/css/ext-all-gray.css" />
+    <link rel="stylesheet" type="text/css" href="../css/plugin.css" />
+    <script type="text/javascript" src="../lib/ext/ext-all.js"></script>
+    <script type="text/javascript" src="plugin.js"></script>    
+</head>
+
+<body>
+	
+	<div id="bar_chart_1"></div>
+	
+	<script>
+		Ext.onReady( function() {
+			DHIS.getChart({
+				type: 'column',
+				indicators: [52486],
+				periods: ['monthsThisYear'],
+				organisationunits: [525],
+				series: 'indicator',
+				category: 'period',
+				filter: 'organisationunit',
+				div: 'bar_chart_1'
+			});
+		});
+	</script>
+	
+</body>
+</html>

=== added file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.js	2011-11-10 20:57:29 +0000
@@ -0,0 +1,873 @@
+DHIS = {};
+DHIS.conf = {
+    finals: {
+        ajax: {
+            url_visualizer: '../',
+            url_commons: '../../dhis-web-commons-ajax-json/',
+            url_portal: '../../dhis-web-portal/',
+            url_indicator: 'getAggregatedIndicatorValuesPlugin',
+            url_dataelement: 'getAggregatedDataValuesPlugin'
+        },        
+        dimension: {
+            indicator: {
+                value: 'indicator',
+                rawvalue: 'Indicator'
+            },
+            dataelement: {
+                value: 'dataelement',
+                rawvalue: 'Data element'
+            },
+            period: {
+                value: 'period',
+                rawvalue: 'Period'
+            },
+            organisationunit: {
+                value: 'organisationunit',
+                rawvalue: 'Organisation unit'
+            }
+        },        
+        chart: {
+            x: 'x',
+            series: 'series',
+            category: 'category',
+            filter: 'filter',
+            column: 'column',
+            column_stacked: 'column_stacked',
+            bar: 'bar',
+            bar_stacked: 'bar_stacked',
+            line: 'line',
+            area: 'area',
+            pie: 'pie'
+        }
+    },
+    style: {
+        label: {
+            period_group: 'font:bold 11px arial; color:#444; line-height:20px'
+        }
+    },
+    layout: {
+        west_cmp_width: 380,
+        west_width: 424,
+        east_tbar_height: 27
+    }
+};
+
+Ext.onReady( function() {
+    DHIS.initialize = function() {
+        DHIS.store.column = DHIS.store.defaultChartStore;
+        DHIS.store.column_stacked = DHIS.store.defaultChartStore;
+        DHIS.store.bar_stacked = DHIS.store.bar;
+        DHIS.store.line = DHIS.store.defaultChartStore;
+        DHIS.store.area = DHIS.store.defaultChartStore;
+        DHIS.store.pie = DHIS.store.defaultChartStore;
+        
+        DHIS.getChart = DHIS.exe.execute;
+    };
+    
+    DHIS.util = {
+        getCmp: function(q) {
+            return DHIS.viewport.query(q)[0];
+        },
+        viewport: {
+            getSize: function() {
+                var c = Ext.getCmp('center');
+                return {x: c.getWidth(), y: c.getHeight()};
+            },
+            getXY: function() {
+                var c = Ext.getCmp('center');
+                return {x: c.x + 15, y: c.y + 43};
+            }
+        },
+        multiselect: {
+            select: function(a, s) {
+                var selected = a.getValue();
+                if (selected.length) {
+                    var array = [];
+                    Ext.Array.each(selected, function(item) {
+                        array.push({id: item, shortName: a.store.getAt(a.store.find('id', item)).data.shortName});
+                    });
+                    s.store.add(array);
+                }
+                this.filterAvailable(a, s);
+            },            
+            selectAll: function(a, s) {
+                var array = [];
+                a.store.each( function(r) {
+                    array.push({id: r.data.id, shortName: r.data.shortName});
+                });
+                s.store.add(array);
+                this.filterAvailable(a, s);
+            },            
+            unselect: function(a, s) {
+                var selected = s.getValue();
+                if (selected.length) {
+                    Ext.Array.each(selected, function(item) {
+                        s.store.remove(s.store.getAt(s.store.find('id', item)));
+                    });                    
+                    this.filterAvailable(a, s);
+                }
+            },
+            unselectAll: function(a, s) {
+                s.store.removeAll();
+                a.store.clearFilter();
+            },
+            filterAvailable: function(a, s) {
+                a.store.filterBy( function(r) {
+                    var filter = true;
+                    s.store.each( function(r2) {
+                        if (r.data.id === r2.data.id) {
+                            filter = false;
+                        }
+                    });
+                    return filter;
+                });
+            }
+        },
+        fieldset: {
+            collapseOthers: function(name) {
+                for (var p in DHIS.conf.finals.dimension) {
+                    if (DHIS.conf.finals.dimension[p].value !== name) {
+                        DHIS.util.getCmp('fieldset[name="' + DHIS.conf.finals.dimension[p].value + '"]').collapse();
+                    }
+                }
+            },
+            toggleIndicator: function() {
+                DHIS.util.getCmp('fieldset[name="' + DHIS.conf.finals.dimension.indicator.value + '"]').toggle();
+            },
+            toggleDataElement: function() {
+                DHIS.util.getCmp('fieldset[name="' + DHIS.conf.finals.dimension.dataelement.value + '"]').toggle();
+            },
+            togglePeriod: function() {
+                DHIS.util.getCmp('fieldset[name="' + DHIS.conf.finals.dimension.period.value + '"]').toggle();
+            },
+            toggleOrganisationUnit: function() {
+                DHIS.util.getCmp('fieldset[name="' + DHIS.conf.finals.dimension.organisationunit.value + '"]').toggle();
+            }
+        },
+        button: {
+            getValue: function() {
+                for (var i = 0; i < DHIS.cmp.charttype.length; i++) {
+                    if (DHIS.cmp.charttype[i].pressed) {
+                        return DHIS.cmp.charttype[i].name;
+                    }
+                }
+            },
+            toggleHandler: function(b) {
+                if (!b.pressed) {
+                    b.toggle();
+                }
+            }
+        },
+        store: {
+            addToStorage: function(s) {
+                s.each( function(r) {
+                    if (!s.storage[r.data.id]) {
+                        s.storage[r.data.id] = {id: r.data.id, shortName: r.data.shortName, name: r.data.shortName, parent: s.parent};
+                    }
+                });
+            },
+            loadFromStorage: function(s) {
+                var items = [];
+                s.removeAll();
+                for (var obj in s.storage) {
+                    if (s.storage[obj].parent === s.parent) {
+                        items.push(s.storage[obj]);
+                    }
+                }
+                items = Ext.Array.sort(items);
+                s.add(items);
+            },
+            containsParent: function(s) {
+                for (var obj in s.storage) {
+                    if (s.storage[obj].parent === s.parent) {
+                        return true;
+                    }
+                }
+                return false;
+            }
+        },
+        dimension: {
+            indicator: {
+                getUrl: function(isFilter) {
+                    var a = [];
+                    Ext.Array.each( DHIS.state.conf.indicators, function(r) {
+                        a.push('indicatorIds=' + r);
+                    });
+                    return (isFilter && a.length > 1) ? a.slice(0,1) : a;
+                },
+                getNames: function(exception) {
+                    var a = [];
+                    DHIS.util.getCmp('multiselect[name="selectedIndicators"]').store.each( function(r) {
+                        a.push(DHIS.util.chart.getEncodedSeriesName(r.data.shortName));
+                    });
+                    if (exception && !a.length) {
+                        alert('No indicators selected');
+                    }
+                    return a;
+                }
+            },
+            dataelement: {
+                getUrl: function(isFilter) {
+                    var a = [];
+                    DHIS.state.conf.dataelements.each( function(r) {
+                        a.push('dataElementIds=' + r.data.id);
+                    });
+                    return (isFilter && a.length > 1) ? a.slice(0,1) : a;
+                },
+                getNames: function(exception) {
+                    var a = [];
+                    DHIS.util.getCmp('multiselect[name="selectedDataElements"]').store.each( function(r) {
+                        a.push(DHIS.util.chart.getEncodedSeriesName(r.data.shortName));
+                    });
+                    if (exception && !a.length) {
+                        alert('No data elements selected');
+                    }
+                    return a;
+                }
+            },
+            period: {
+                getUrl: function(isFilter) {
+                    var a = [];
+                    Ext.Array.each(DHIS.state.conf.periods, function(r) {
+						a.push(r + '=true')
+                    });
+                    return (isFilter && a.length > 1) ? a.slice(0,1) : a;
+                },
+                getNames: function(exception) {
+                    var a = [],
+                        cmp = DHIS.cmp.dimension.period;
+                    Ext.Array.each(cmp, function(item) {
+                        if (item.getValue()) {
+                            Ext.Array.each(DHIS.init.system.periods[item.paramName], function(item) {
+                                a.push(DHIS.util.chart.getEncodedSeriesName(item.name));
+                            });
+                        }
+                    });
+                    if (exception && !a.length) {
+                        alert('No periods selected');
+                    }
+                    return a;
+                },
+                getNameById: function(id) {
+                    for (var obj in DHIS.init.system.periods) {
+                        var a = DHIS.init.system.periods[obj];
+                        for (var i = 0; i < a.length; i++) {
+                            if (a[i].id == id) {
+                                return a[i].name;
+                            }
+                        };
+                    }
+                }
+            },
+            organisationunit: {
+                getUrl: function(isFilter) {
+                    var a = [];
+                    Ext.Array.each(DHIS.state.conf.organisationunits, function(r) {
+						a.push('organisationUnitIds=' + r)
+                    });
+                    return (isFilter && a.length > 1) ? a.slice(0,1) : a;
+                },
+                getNames: function(exception) {
+                    var a = [],
+                        treepanel = DHIS.util.getCmp('treepanel'),
+                        selection = treepanel.getSelectionModel().getSelection();
+                    if (!selection.length) {
+                        selection = [treepanel.getRootNode()];
+                        treepanel.selectRoot();
+                    }
+                    Ext.Array.each(selection, function(r) {
+                        a.push(DHIS.util.chart.getEncodedSeriesName(r.data.text));
+                    });
+                    if (exception && !a.length) {
+                        alert('No organisation units selected');
+                    }
+                    return a;                        
+                }
+            }
+        },
+        chart: {
+            getEncodedSeriesName: function(text) {
+                return text.replace(/\./g,'');
+            },
+            getLegend: function(len) {
+                return {
+                    position: len > 6 ? 'right' : 'top',
+                    boxStroke: '#ffffff',
+                    boxStrokeWidth: 0
+                };
+            },
+            getGrid: function() {
+                return {
+                    opacity: 1,
+                    fill: '#f1f1f1',
+                    stroke: '#aaa',
+                    'stroke-width': 0.2
+                };
+            },
+            line: {
+                getSeriesArray: function() {
+                    var a = [];
+                    for (var i = 0; i < DHIS.store.chart.left.length; i++) {
+                        a.push({
+                            type: 'line',
+                            axis: 'left',
+                            xField: DHIS.store.chart.bottom,
+                            yField: DHIS.store.chart.left[i]
+                        });
+                    }
+                    return a;
+                }
+            }
+        },
+        combobox: {
+            filter: {
+                clearValue: function(v, cb, i, d) {
+                    if (v === cb.getValue()) {
+                        cb.clearValue();
+                    }
+                    else if ((v === i || v === d) && (cb.getValue() === i || cb.getValue() === d)) {
+                        cb.clearValue();
+                    }
+                },
+                category: function(vp) {
+                    var cbs = vp.query('combobox[name="' + DHIS.conf.finals.chart.series + '"]')[0],
+                        cbc = vp.query('combobox[name="' + DHIS.conf.finals.chart.category + '"]')[0],
+                        cbf = vp.query('combobox[name="' + DHIS.conf.finals.chart.filter + '"]')[0],
+                        v = cbs.getValue(),
+                        i = DHIS.conf.finals.dimension.indicator.value,
+                        d = DHIS.conf.finals.dimension.dataelement.value,
+                        p = DHIS.conf.finals.dimension.period.value,
+                        o = DHIS.conf.finals.dimension.organisationunit.value,
+                        index = 0;
+                        
+                    this.clearValue(v, cbc, i, d);
+                    this.clearValue(v, cbf, i, d);
+                    
+                    cbc.filterArray = [!(v === i || v === d), !(v === i || v === d), !(v === p), !(v === o)];
+                    cbc.store.filterBy( function(r) {
+                        return cbc.filterArray[index++];
+                    });
+                    
+                    this.filter(vp);
+                },                
+                filter: function(vp) {
+                    var cbc = vp.query('combobox[name="' + DHIS.conf.finals.chart.category + '"]')[0],
+                        cbf = vp.query('combobox[name="' + DHIS.conf.finals.chart.filter + '"]')[0],
+                        v = cbc.getValue(),
+                        i = DHIS.conf.finals.dimension.indicator.value,
+                        d = DHIS.conf.finals.dimension.dataelement.value,
+                        p = DHIS.conf.finals.dimension.period.value,
+                        o = DHIS.conf.finals.dimension.organisationunit.value,
+                        index = 0;
+                        
+                    this.clearValue(v, cbf, i, d);
+                        
+                    cbf.filterArray = Ext.Array.clone(cbc.filterArray);
+                    cbf.filterArray[0] = cbf.filterArray[0] ? !(v === i || v === d) : false;
+                    cbf.filterArray[1] = cbf.filterArray[1] ? !(v === i || v === d) : false;
+                    cbf.filterArray[2] = cbf.filterArray[2] ? !(v === p) : false;
+                    cbf.filterArray[3] = cbf.filterArray[3] ? !(v === o) : false;
+                    
+                    cbf.store.filterBy( function(r) {
+                        return cbf.filterArray[index++];
+                    });
+                }
+            }
+        },
+		window: {
+			datatable: {
+				getHeight: function() {
+					if (DHIS.value.values.length) {
+						if (Ext.isWindows && Ext.isGecko) {
+							return 22 * DHIS.value.values.length + 57;
+						}
+						else if (Ext.isWindows && Ext.isIE) {
+							return 21 * DHIS.value.values.length + 58;
+						}
+						else {
+							return 21 * DHIS.value.values.length + 57;
+						}
+					}
+				}
+			}
+		},
+        number: {
+            isInteger: function(n) {
+                var str = new String(n);
+                if (str.indexOf('.') > -1) {
+                    var d = str.substr(str.indexOf('.') + 1);
+                    return (d.length === 1 && d == '0');
+                }
+                return false;
+            },
+            allValuesAreIntegers: function(values) {
+                for (var i = 0; i < values.length; i++) {
+                    if (!this.isInteger(values[i].v)) {
+                        return false;
+                    }
+                }
+                return true;
+            },
+            getChartAxisFormatRenderer: function() {
+                return this.allValuesAreIntegers(DHIS.value.values) ? '0' : '0.0';
+            }
+        }
+    };
+    
+    DHIS.store = {
+        datatable: null,
+        getDataTableStore: function(exe) {
+            this.datatable = Ext.create('Ext.data.Store', {
+                fields: [
+                    DHIS.state.getIndiment().value,
+                    DHIS.conf.finals.dimension.period.value,
+                    DHIS.conf.finals.dimension.organisationunit.value,
+                    'v'
+                ],
+                data: DHIS.value.values
+            });
+            
+            if (exe) {
+                DHIS.datatable.getDataTable(true);
+            }
+            else {
+                return this.datatable;
+            }
+            
+        },
+        chart: null,
+        getChartStore: function() {
+            this[DHIS.state.type]();
+        },
+        defaultChartStore: function() {
+            var keys = [];
+            Ext.Array.each(DHIS.chart.data, function(item) {
+                keys = Ext.Array.merge(keys, Ext.Object.getKeys(item));
+            });
+            this.chart = Ext.create('Ext.data.Store', {
+                fields: keys,
+                data: DHIS.chart.data
+            });
+            this.chart.bottom = [DHIS.conf.finals.chart.x];
+            this.chart.left = keys.slice(0);
+            for (var i = 0; i < this.chart.left.length; i++) {
+                if (this.chart.left[i] === DHIS.conf.finals.chart.x) {
+                    this.chart.left.splice(i, 1);
+                }
+            }
+            
+			DHIS.chart.getChart(true);
+        },
+        bar: function() {
+            var properties = Ext.Object.getKeys(DHIS.chart.data[0]);
+            this.chart = Ext.create('Ext.data.Store', {
+                fields: properties,
+                data: DHIS.chart.data
+            });
+            this.chart.left = properties.slice(0, 1);
+            this.chart.bottom = properties.slice(1, properties.length);
+            
+			DHIS.chart.getChart(true);
+        }
+    };
+    
+    DHIS.state = {
+		conf: null,
+        type: DHIS.conf.finals.chart.column,
+        indiment: [],
+        period: [],
+        organisationunit: [],
+        series: {
+            cmp: null,
+            dimension: DHIS.conf.finals.dimension.indicator.value,
+            data: []
+        },
+        category: {
+            cmp: null,
+            dimension: DHIS.conf.finals.dimension.period.value,
+            data: []
+        },
+        filter: {
+            cmp: null,
+            dimension: DHIS.conf.finals.dimension.organisationunit.value,
+            data: []
+        },
+        getState: function(conf) {
+            this.resetState(conf);
+            
+            this.type = conf.type;
+            this.series.dimension = conf.series;
+            this.category.dimension = conf.category;
+            this.filter.dimension = conf.filter;
+            
+            //DHIS.getChart({
+				//type: 'column',
+				//indicators: [359596,359596],
+				//periods: ['monthsThisYear'],
+				//organisationunits: [525],
+				//series: 'i',
+				//category: 'p',
+				//filter: 'o',
+				//div: 'bar_chart_1'
+			//});
+            
+			DHIS.value.getValues();
+        },
+        getIndiment: function() {
+            var i = DHIS.conf.finals.dimension.indicator.value;
+            return (this.series.dimension === i || this.category.dimension === i || this.filter.dimension === i) ?
+                DHIS.conf.finals.dimension.indicator : DHIS.conf.finals.dimension.dataelement;
+        },
+        isIndicator: function() {
+            var i = DHIS.conf.finals.dimension.indicator.value;
+            return (this.series.dimension === i || this.category.dimension === i || this.filter.dimension === i);
+        },
+        resetState: function(conf) {
+			this.conf = conf;
+            this.indiment = null;
+            this.period = null;
+            this.organisationunit = null;
+            this.series.dimension = null;
+            this.series.data = null;
+            this.category.dimension = null;
+            this.category.data = null;
+            this.filter.dimension = null;
+            this.filter.data = null;
+        }
+    };
+    
+    DHIS.value = {
+        values: [],
+        getValues: function() {
+            var params = [],
+                indicator = DHIS.conf.finals.dimension.indicator.value,
+                dataelement = DHIS.conf.finals.dimension.dataelement.value,
+                series = DHIS.state.series.dimension,
+                category = DHIS.state.category.dimension,
+                filter = DHIS.state.filter.dimension,
+                indiment = DHIS.state.getIndiment().value,
+                url = DHIS.state.isIndicator() ? DHIS.conf.finals.ajax.url_indicator : DHIS.conf.finals.ajax.url_dataelement;
+                
+            params = params.concat(DHIS.util.dimension[series].getUrl());
+            params = params.concat(DHIS.util.dimension[category].getUrl());
+            params = params.concat(DHIS.util.dimension[filter].getUrl(true));
+alert(params);            
+            
+            var baseUrl = DHIS.conf.finals.ajax.url_visualizer + url + '.action';
+            Ext.Array.each(params, function(item) {
+                baseUrl = Ext.String.urlAppend(baseUrl, item);
+            });
+alert(baseUrl);            
+            
+            Ext.Ajax.request({
+                url: baseUrl,
+                success: function(r) {
+                    DHIS.value.values = Ext.JSON.decode(r.responseText).values;
+                    
+                    if (!DHIS.value.values.length) {
+                        alert('no data values');
+                        return;
+                    }
+                    
+                    Ext.Array.each(DHIS.value.values, function(item) {
+                        item.v = parseFloat(item.v);
+                    });
+                    
+					DHIS.chart.getData();
+                }
+            });
+        }
+    };
+    
+    DHIS.chart = {
+        data: [],        
+        getData: function() {
+            this.data = [];
+			
+            Ext.Array.each(DHIS.state.category.data, function(item) {
+                var obj = {};
+                obj[DHIS.conf.finals.chart.x] = item;
+                DHIS.chart.data.push(obj);
+            });
+            
+            Ext.Array.each(DHIS.chart.data, function(item) {
+                for (var i = 0; i < DHIS.state.series.data.length; i++) {
+                    for (var j = 0; j < DHIS.value.values.length; j++) {
+                        if (DHIS.value.values[j][DHIS.state.category.dimension] === item[DHIS.conf.finals.chart.x] && DHIS.value.values[j][DHIS.state.series.dimension] === DHIS.state.series.data[i]) {
+                            item[DHIS.value.values[j][DHIS.state.series.dimension]] = DHIS.value.values[j].v;
+                            break;
+                        }
+                    }
+                }
+            });
+                
+			DHIS.store.getChartStore(true);
+        },        
+        chart: null,
+        getChart: function() {
+            this[DHIS.state.type]();
+			this.reload();
+        },
+        column: function(stacked) {
+            this.chart = Ext.create('Ext.chart.Chart', {
+				renderTo: DV.state.conf.div,
+                width: DHIS.util.viewport.getSize().x,
+                height: DHIS.util.viewport.getSize().y,
+                animate: true,
+                store: DHIS.store.chart,
+                legend: DHIS.util.chart.getLegend(DHIS.state.series.data.length),
+                axes: [
+                    {
+                        title: 'Value',
+                        type: 'Numeric',
+                        position: 'left',
+                        minimum: 0,
+                        fields: DHIS.store.chart.left,
+                        grid: {
+                            even: DHIS.util.chart.getGrid()
+                        },
+                        label: {
+                            renderer: Ext.util.Format.numberRenderer(DHIS.util.number.getChartAxisFormatRenderer())
+                        }
+                    },
+                    {
+                        title: DHIS.init.isInit ? 'Categories' : DHIS.conf.finals.dimension[DHIS.state.category.dimension].rawvalue,
+                        type: 'Category',
+                        position: 'bottom',
+                        fields: DHIS.store.chart.bottom
+                    }
+                ],
+                series: [
+                    {
+                        type: 'column',
+                        axis: 'left',
+                        xField: DHIS.store.chart.bottom,
+                        yField: DHIS.store.chart.left,
+                        stacked: stacked,
+                        style: {
+                            opacity: 0.8
+                        }
+                    }
+                ]
+            });
+        },
+        column_stacked: function() {
+            this.column(true);
+        },
+        bar: function(stacked) {
+            this.chart = Ext.create('Ext.chart.Chart', {
+                width: DHIS.util.viewport.getSize().x,
+                height: DHIS.util.viewport.getSize().y,
+                animate: true,
+                store: DHIS.store.chart,
+                legend: DHIS.util.chart.getLegend(DHIS.state.series.data.length),
+                axes: [
+                    {
+                        title: DHIS.conf.finals.dimension[DHIS.state.category.dimension].rawvalue,
+                        type: 'Category',
+                        position: 'left',
+                        fields: DHIS.store.chart.left
+                    },
+                    {
+                        title: 'Value',
+                        type: 'Numeric',
+                        position: 'bottom',
+                        minimum: 0,
+                        fields: DHIS.store.chart.bottom,
+                        label: {
+                            renderer: Ext.util.Format.numberRenderer(DHIS.util.number.getChartAxisFormatRenderer())
+                        },
+                        grid: {
+                            even: DHIS.util.chart.getGrid()
+                        }
+                    }
+                ],
+                series: [
+                    {
+                        type: 'bar',
+                        axis: 'bottom',
+                        xField: DHIS.store.chart.left,
+                        yField: DHIS.store.chart.bottom,
+                        stacked: stacked,
+                        style: {
+                            opacity: 0.8
+                        }
+                    }
+                ]
+            });
+        },
+        bar_stacked: function() {
+            this.bar(true);
+        },
+        line: function() {
+            this.chart = Ext.create('Ext.chart.Chart', {
+                width: DHIS.util.viewport.getSize().x,
+                height: DHIS.util.viewport.getSize().y,
+                animate: true,
+                store: DHIS.store.chart,
+                legend: DHIS.util.chart.getLegend(DHIS.state.series.data.length),
+                axes: [
+                    {
+                        title: 'Value',
+                        type: 'Numeric',
+                        position: 'left',
+                        minimum: 0,
+                        fields: DHIS.store.chart.left,
+                        label: {
+                            renderer: Ext.util.Format.numberRenderer(DHIS.util.number.getChartAxisFormatRenderer())
+                        },
+                        grid: {
+                            even: DHIS.util.chart.getGrid()
+                        }
+                    },
+                    {
+                        title: DHIS.conf.finals.dimension[DHIS.state.category.dimension].rawvalue,
+                        type: 'Category',
+                        position: 'bottom',
+                        fields: DHIS.store.chart.bottom
+                    }
+                ],
+                series: DHIS.util.chart.line.getSeriesArray()
+            });
+        },
+        area: function() {
+            this.chart = Ext.create('Ext.chart.Chart', {
+                width: DHIS.util.viewport.getSize().x,
+                height: DHIS.util.viewport.getSize().y,
+                animate: true,
+                store: DHIS.store.chart,
+                legend: DHIS.util.chart.getLegend(DHIS.state.series.data.length),
+                axes: [
+                    {
+                        title: 'Value',
+                        type: 'Numeric',
+                        position: 'left',
+                        minimum: 0,
+                        fields: DHIS.store.chart.left,
+                        label: {
+                            renderer: Ext.util.Format.numberRenderer(DHIS.util.number.getChartAxisFormatRenderer())
+                        },
+                        grid: {
+                            even: DHIS.util.chart.getGrid()
+                        }
+                    },
+                    {
+                        title: DHIS.conf.finals.dimension[DHIS.state.category.dimension].rawvalue,
+                        type: 'Category',
+                        position: 'bottom',
+                        fields: DHIS.store.chart.bottom
+                    }
+                ],
+                series: [{
+                    type: 'area',
+                    axis: 'left',
+                    xField: DHIS.store.chart.bottom[0],
+                    yField: DHIS.store.chart.left,
+                    style: {
+                        opacity: 0.65
+                    }
+                }]
+            });
+        },
+        pie: function() {
+            this.chart = Ext.create('Ext.chart.Chart', {
+                width: DHIS.util.viewport.getSize().x,
+                height: DHIS.util.viewport.getSize().y,
+                animate: true,
+                shadow: true,
+                store: DHIS.store.chart,
+                legend: DHIS.util.chart.getLegend(DHIS.state.category.data.length),
+                insetPadding: 60,
+                series: [{
+                    type: 'pie',
+                    field: DHIS.store.chart.left[0],
+                    showInLegend: true,
+                    tips: {
+                        trackMouse: false,
+                        width: 160,
+                        height: 31,
+                        renderer: function(i) {
+                            this.setTitle('<span class="DHIS-chart-tips">' + i.data.x + ': <b>' + i.data[DHIS.store.chart.left[0]] + '</b></span>');
+                        }
+                    },
+                    label: {
+                        field: DHIS.store.chart.bottom[0]
+                    },
+                    highlight: {
+                        segment: {
+                            margin: 10
+                        }
+                    },
+                    style: {
+                        opacity: 0.9
+                    }
+                }]
+            });
+        },
+        reload: function() {
+            var c = Ext.getCmp('center');
+            c.removeAll(true);
+            c.add(this.chart);
+        }
+    };
+    
+    DHIS.datatable = {
+        datatable: null,
+        getDataTable: function(exe) {
+            this.datatable = Ext.create('Ext.grid.Panel', {
+                height: DHIS.util.viewport.getSize().y - DHIS.conf.layout.east_tbar_height,
+                scroll: 'vertical',
+                cls: 'DHIS-datatable',
+                columns: [
+                    {
+                        text: DHIS.state.getIndiment().rawvalue,
+                        dataIndex: DHIS.state.getIndiment().value,
+                        width: 150
+                    },
+                    {
+                        text: DHIS.conf.finals.dimension.period.rawvalue,
+                        dataIndex: DHIS.conf.finals.dimension.period.value,
+                        width: 100,
+                        sortable: false
+                    },
+                    {
+                        text: DHIS.conf.finals.dimension.organisationunit.rawvalue,
+                        dataIndex: DHIS.conf.finals.dimension.organisationunit.value,
+                        width: 150
+                    },
+                    {
+                        text: 'Value',
+                        dataIndex: 'v',
+                        width: 80
+                    }
+                ],
+                store: DHIS.store.datatable,
+                listeners: {
+                    afterrender: function() {
+                        DHIS.cmp.datatable = this;
+                    }
+                }
+            });
+            
+            if (exe) {
+                this.reload();
+            }
+            else {
+                return this.datatable;
+            }
+        },
+        reload: function() {
+            var c = DHIS.util.getCmp('panel[region="east"]');
+            c.removeAll(true);
+            c.add(this.datatable);
+        }            
+    };
+    
+    DHIS.exe = {
+        execute: function(conf) {
+			DHIS.state.getState(conf);
+		}
+    };
+    
+    DHIS.initialize();
+});

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedDataValues.vm'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedDataValues.vm	2011-09-29 09:10:42 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedDataValues.vm	2011-11-08 15:53:59 +0000
@@ -1,1 +1,1 @@
-#set( $size = $object.size() ){"values":[#foreach( $value in $object ){"v":"$!{value.value}","i":"$!{value.dataElementId}","p":"$!{value.periodId}","o":"$!{value.organisationUnitId}"}#if( $velocityCount < $size ),#end#end]}
\ No newline at end of file
+#set( $size = $object.size() ){"values":[#foreach( $value in $object ){"v":"$!{value.value}","i":"$!{value.dataElementId}","in":"$!{value.dataElementName}","p":"$!{value.periodId}","pn":"$!{value.periodName}","o":"$!{value.organisationUnitId}","on":"$!{value.organisationUnitName}"}#if( $velocityCount < $size ),#end#end]}
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedDataValuesPlugin.vm'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedDataValuesPlugin.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedDataValuesPlugin.vm	2011-11-08 12:44:02 +0000
@@ -0,0 +1,1 @@
+#set( $size = $object.size() ){"values":[#foreach( $value in $object ){"v":"$!{value.value}","i":"$!{value.dataElementId}","p":"$!{value.periodId}","o":"$!{value.organisationUnitId}"}#if( $velocityCount < $size ),#end#end]}
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedIndicatorValuesPlugin.vm'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedIndicatorValuesPlugin.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedIndicatorValuesPlugin.vm	2011-11-08 12:44:02 +0000
@@ -0,0 +1,1 @@
+#set( $size = $object.size() ){"values":[#foreach( $value in $object ){"v":"$!{value.value}","i":"$!{value.indicatorId}","in":"$!{value.indicatorName}","p":"$!{value.periodId}","pn":"$!{value.periodName}","o":"$!{value.organisationUnitId}","on":"$!{value.organisationUnitName}"}#if( $velocityCount < $size ),#end#end]}
\ No newline at end of file