← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5245: Minor DV fixes + Chart properties added.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 5245 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-11-30 15:41:00 +0100
message:
  Minor DV fixes + Chart properties added.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js


--
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-11-25 18:32:06 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2011-11-30 14:39:36 +0000
@@ -57,87 +57,107 @@
 {
     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 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_BAR3D = "bar3d";
+    
+            public static final String TYPE_STACKED_BAR3D = "stackedBar3d";
+    
+            public static final String TYPE_LINE3D = "line3d";
+    
+            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";
+        
+            public static final String TYPE = "tall";
+    
+    public static final String TYPE_COLUMN = "column";
+    
+    public static final String TYPE_STACKED_COLUMN = "stackedColumn";
+    
     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_LINE = "line";
-
-    public static final String TYPE_LINE3D = "line3d";
-
+    
+    public static final String TYPE_AREA = "area";
+    
     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";
-
+    
+    public static final String DIMENSION_DATA = "data";
+    
+    public static final String DIMENSION_PERIOD = "period";
+    
+    public static final String DIMENSION_ORGANISATIONUNIT = "organisationUnit";
+    
     private String domainAxixLabel;
 
     private String rangeAxisLabel;
 
     private String type;
 
-    private String size;
-
-    private String dimension;
-
-    private boolean hideLegend;
-
-    private boolean verticalLabels;
-
-    private boolean horizontalPlotOrientation;
-
-    private boolean regression;
-
-    private boolean targetLine;
-
-    private boolean hideSubtitle;
-
-    private Double targetLineValue;
-
-    private String targetLineLabel;
-
-    private Set<ChartGroup> groups = new HashSet<ChartGroup>();
+            private String size;
+
+            private String dimension;
+            
+    private String series;
+    
+    private String category;
+    
+    private String filter;
+
+            private boolean hideLegend;
+        
+            private boolean verticalLabels;
+
+            private boolean horizontalPlotOrientation;
+
+            private boolean regression;
+        
+            private boolean targetLine;
+        
+            private boolean hideSubtitle;
+
+            private Double targetLineValue;
+        
+            private String targetLineLabel;
+
+            private Set<ChartGroup> groups = new HashSet<ChartGroup>();
 
     private List<Indicator> indicators = new ArrayList<Indicator>();
 
     private List<DataElement> dataElements = new ArrayList<DataElement>();
 
-    private List<DataSet> dataSets = new ArrayList<DataSet>();
+            private List<DataSet> dataSets = new ArrayList<DataSet>();
 
     private List<Period> periods = new ArrayList<Period>();
 
     private List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>();
 
-    private RelativePeriods relatives;
+            private RelativePeriods relatives;
 
-    private boolean userOrganisationUnit;
+            private boolean userOrganisationUnit;
 
     // -------------------------------------------------------------------------
     // Transient properties
@@ -341,6 +361,42 @@
     {
         this.dimension = dimension;
     }
+    
+    @XmlElement
+    @JsonProperty
+    public String getSeries()
+    {
+        return series;
+    }
+
+    public void setSeries( String series )
+    {
+        this.series = series;
+    }
+    
+    @XmlElement
+    @JsonProperty
+    public String getCategory()
+    {
+        return category;
+    }
+
+    public void setCategory( String category )
+    {
+        this.category = category;
+    }
+    
+    @XmlElement
+    @JsonProperty
+    public String getFilter()
+    {
+        return filter;
+    }
+
+    public void setFilter( String filter )
+    {
+        this.filter = filter;
+    }
 
     @XmlElement
     @JsonProperty

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml	2011-11-23 18:07:35 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml	2011-11-30 14:39:36 +0000
@@ -25,6 +25,12 @@
 
     <property name="dimension" />
 
+    <property name="series" />
+
+    <property name="category" />
+
+    <property name="filter" />
+
     <property name="hideLegend" not-null="true" />
 
     <property name="verticalLabels" not-null="true" />

=== 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-30 11:27:50 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js	2011-11-30 14:39:36 +0000
@@ -366,7 +366,7 @@
             getTitle: function(isPie) {
                 return {
                     type: 'text',
-                    text: DV.init.isInit ? 'Example chart' : isPie ? DV.state.filter.names[0] + ' / ' + DV.state.series.names[0] : DV.state.filter.names[0],
+                    text: DV.init.isInit ? 'Example chart' : isPie ? DV.state.filter.names[0] + '\n' + DV.state.series.names[0] : DV.state.filter.names[0],
                     font: 'bold 15px arial',
                     fill: '#222',
                     width: 300,
@@ -388,6 +388,32 @@
                     }
                     return a;
                 }
+            },
+            pie: {
+                getTitle: function() {
+                    return [
+                        {
+                            type: 'text',
+                            text: DV.state.filter.names[0],
+                            font: 'bold 15px arial',
+                            fill: '#222',
+                            width: 300,
+                            height: 20,
+                            x: 28,
+                            y: 16
+                        },
+                        {
+                            type: 'text',
+                            text: DV.state.series.names[0],
+                            font: 'bold 13px arial',
+                            fill: '#777',
+                            width: 300,
+                            height: 20,
+                            x: 28,
+                            y: 36
+                        }
+                    ];                        
+                }
             }
         },
         combobox: {
@@ -899,7 +925,7 @@
                 shadow: true,
                 store: DV.store.chart,
                 insetPadding: 60,
-                items: DV.util.chart.getTitle(true),
+                items: DV.util.chart.pie.getTitle(),
                 legend: DV.util.chart.getLegend(DV.state.category.names.length),
                 series: [{
                     type: 'pie',
@@ -1868,9 +1894,9 @@
                                         shadowOffset: 1,
                                         items: [
                                             {
-                                                text: 'Image',
+                                                text: 'Image (PNG)',
                                                 iconCls: 'dv-menu-item-png',
-                                                minWidth: 90,
+                                                minWidth: 110,
                                                 handler: function() {
                                                     b.execute(DV.conf.finals.image.png);
                                                 }
@@ -1878,7 +1904,7 @@
                                             {
                                                 text: 'PDF',
                                                 iconCls: 'dv-menu-item-pdf',
-                                                minWidth: 90,
+                                                minWidth: 110,
                                                 handler: function() {
                                                     b.execute(DV.conf.finals.image.pdf);
                                                 }