← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4893: (DV) Example chart created during startup.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 4893 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-10-11 13:22:00 +0200
message:
  (DV) Example chart created during startup.
added:
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/datatable.png
modified:
  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/css/style.css


--
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-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-10-10 16:06:24 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js	2011-10-11 11:21:03 +0000
@@ -64,6 +64,29 @@
         success: function(r) {
             
     DV.init = Ext.JSON.decode(r.responseText);
+    
+    DV.init.initialize = function(vp) {
+        var s = vp.query('combobox[name="' + DV.conf.finals.chart.series + '"]')[0];
+        s.filter(s, vp);
+        var c = vp.query('combobox[name="' + DV.conf.finals.chart.category + '"]')[0];
+        c.filter(c, vp);
+        
+        DV.store.column = DV.store.defaultChartStore;
+        DV.store.column_stacked = DV.store.defaultChartStore;
+        DV.store.bar_stacked = DV.store.bar;
+        DV.store.line = DV.store.defaultChartStore;
+        DV.store.area = DV.store.defaultChartStore;
+        DV.store.pie = DV.store.defaultChartStore;
+        
+        DV.data.data = [
+            {x: 'Category 1', 'Series 1': 41, 'Series 2': 69, 'Series 3': 63, 'Series 4': 51},
+            {x: 'Category 2', 'Series 1': 51, 'Series 2': 42, 'Series 3': 58, 'Series 4': 52},
+            {x: 'Category 3', 'Series 1': 44, 'Series 2': 71, 'Series 3': 62, 'Series 4': 54},
+        ];
+        
+        DV.chart.init = true;
+        DV.store.getChartStore(true);
+    };
         
     DV.util = {
         getCmp: function(q) {
@@ -71,7 +94,7 @@
         },
         viewport: {
             getSize: function() {
-                var c = DV.util.getCmp('panel[region="center"]');
+                var c = Ext.getCmp('center');
                 return {x: c.getWidth(), y: c.getHeight()};
             }
         },
@@ -286,7 +309,7 @@
             },
             getLegend: function(len) {
                 return {
-                    position: len > 3 ? 'right' : 'top',
+                    position: len > 6 ? 'right' : 'top',
                     boxStroke: '#ffffff',
                     boxStrokeWidth: 0
                 };
@@ -566,6 +589,12 @@
     };
     
     DV.chart = {
+        init: false,
+        isInit: function() {
+            var bool = this.init ? true : false;
+            this.init = false;
+            return bool;
+        },
         chart: null,
         getChart: function(exe) {
             this[DV.state.type]();
@@ -598,7 +627,7 @@
                         }
                     },
                     {
-                        title: DV.conf.finals.dimension[DV.state.category.dimension].rawvalue,
+                        title: this.isInit() ? 'Category dimension' : DV.conf.finals.dimension[DV.state.category.dimension].rawvalue,
                         type: 'Category',
                         position: 'bottom',
                         fields: DV.store.chart.bottom
@@ -772,7 +801,7 @@
             });
         },
         reload: function() {
-            var c = DV.util.getCmp('panel[region="center"]');
+            var c = Ext.getCmp('center');
             c.removeAll(true);
             c.add(this.chart);
         }
@@ -1038,6 +1067,7 @@
                         items: [
                             {
                                 xtype: 'fieldset',
+                                id: 'indicator_fs',
                                 name: DV.conf.finals.dimension.indicator.value,
                                 title: '<a href="javascript:DV.util.fieldset.toggleIndicator();" class="dv-fieldset-title-link">Indicators</a>',
                                 collapsible: true,
@@ -1185,6 +1215,7 @@
                             },                            
                             {
                                 xtype: 'fieldset',
+                                id: 'dataelement_fs',
                                 name: DV.conf.finals.dimension.dataelement.value,
                                 title: '<a href="javascript:DV.util.fieldset.toggleDataElement();" class="dv-fieldset-title-link">Data elements</a>',
                                 collapsed: true,
@@ -1333,6 +1364,7 @@
                             },                            
                             {
                                 xtype: 'fieldset',
+                                id: 'period_fs',
                                 name: DV.conf.finals.dimension.period.value,
                                 title: '<a href="javascript:DV.util.fieldset.togglePeriod();" class="dv-fieldset-title-link">Periods</a>',
                                 collapsed: true,
@@ -1467,6 +1499,7 @@
                             },                            
                             {
                                 xtype: 'fieldset',
+                                id: 'organisationunit_fs',
                                 name: DV.conf.finals.dimension.organisationunit.value,
                                 title: '<a href="javascript:DV.util.fieldset.toggleOrganisationUnit();" class="dv-fieldset-title-link">Organisation units</a>',
                                 collapsed: true,
@@ -1554,6 +1587,7 @@
                 }
             },
             {
+                id: 'center',
                 region: 'center',
                 layout: 'fit',
                 bodyStyle: 'padding:10px',
@@ -1576,13 +1610,66 @@
                     ' ',
                     {
                         xtype: 'button',
-                        text: 'Update..',
+                        text: 'Update',
                         cls: 'x-btn-text-icon',
                         icon: 'images/refresh.png',
                         handler: function() {
                             DV.state.getState(true);
                         }
                     },
+                    //{
+                        //xtype: 'button',
+                        //text: 'Data table',
+                        //cls: 'x-btn-text-icon',
+                        //icon: 'images/datatable.png',
+                        //handler: function() {
+                            //Ext.create('Ext.window.Window', {
+                                //title: 'Data table',
+                                //layout: 'fit',
+                                //iconCls: 'dv-window-title-datatable',
+                                //width: 580,
+                                //height: DV.viewport.getHeight() / 1.5,
+                                //items: [
+                                    //{
+                                        //xtype: 'grid',
+                                        //layout: 'vbox',
+                                        //scroll: 'vertical',
+                                        //columns: [
+                                            //{
+                                                //text: DV.conf.finals.dimension.indicator.rawvalue,
+                                                //dataIndex: DV.conf.finals.dimension.indicator.value,
+                                                //width: 150
+                                            //},
+                                            //{
+                                                //text: DV.conf.finals.dimension.period.rawvalue,
+                                                //dataIndex: DV.conf.finals.dimension.period.value,
+                                                //width: 150
+                                            //},
+                                            //{
+                                                //text: DV.conf.finals.dimension.organisationunit.rawvalue,
+                                                //dataIndex: DV.conf.finals.dimension.organisationunit.value,
+                                                //width: 150
+                                            //},
+                                            //{
+                                                //text: 'Value',
+                                                //dataIndex: 'v',
+                                                //width: 100
+                                            //}
+                                        //],
+                                        //store: Ext.create('Ext.data.Store', {
+                                            //fields: [
+                                                //DV.conf.finals.dimension.indicator.value,
+                                                //DV.conf.finals.dimension.period.value,
+                                                //DV.conf.finals.dimension.organisationunit.value,
+                                                //'v'
+                                            //],
+                                            //data: DV.data.values
+                                        //})
+                                    //}
+                                //]
+                            //}).show();
+                        //}
+                    //},
                     {
                         xtype: 'label',
                         text: '',
@@ -1591,7 +1678,7 @@
                     '->',
                     {
                         xtype: 'button',
-                        text: 'Exit..',
+                        text: 'Exit',
                         cls: 'x-btn-text-icon',
                         icon: 'images/exit.png',
                         handler: function() {
@@ -1603,17 +1690,7 @@
         ],
         listeners: {
             afterrender: function(vp) {
-                var s = this.query('combobox[name="' + DV.conf.finals.chart.series + '"]')[0];
-                s.filter(s, vp);
-                var c = this.query('combobox[name="' + DV.conf.finals.chart.category + '"]')[0];
-                c.filter(c, vp);
-                
-                DV.store.column = DV.store.defaultChartStore;
-                DV.store.column_stacked = DV.store.defaultChartStore;
-                DV.store.bar_stacked = DV.store.bar;
-                DV.store.line = DV.store.defaultChartStore;
-                DV.store.area = DV.store.defaultChartStore;
-                DV.store.pie = DV.store.defaultChartStore;
+                DV.init.initialize(vp);
             },
             resize: function() {
                 this.query('panel[region="west"]')[0].setWidth(DV.conf.layout.west_width);

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/style.css'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/style.css	2011-10-10 12:12:21 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/style.css	2011-10-11 11:21:03 +0000
@@ -53,7 +53,7 @@
 }
 
 /* Fieldset trigger icons */
-.x-tool img {
+#indicator_fs .x-tool img, #dataelement_fs .x-tool img, #period_fs .x-tool img, #organisationunit_fs .x-tool img {
     background-image: url('../images/tool-sprites.gif');
     width: 25px;
 }
@@ -105,11 +105,11 @@
 }
 
 /* Multiselect /*(custom) transparent row hover */
-.dv-multiselect .x-boundlist-item-over {
+#indicator_fs .x-boundlist-item-over, #dataelement_fs .x-boundlist-item-over {
     background-color: transparent;
     border-color: #fff;
 }
-.dv-multiselect .x-boundlist-selected {
+#indicator_fs .x-boundlist-selected, #dataelement_fs .x-boundlist-selected {
     background-color: #d3d3d3;
     border-color: #b3abaa;
 }
@@ -263,4 +263,10 @@
     font: normal 13px arial;
     padding: 0 0 3px 3px;
 }
+
+/* Window */
+.dv-window-title-datatable {
+    padding-left: 19px;
+    background-image: url('../images/datatable.png');
+}
     

=== added file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/datatable.png'
Binary files dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/datatable.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/datatable.png	2011-10-11 11:21:03 +0000 differ