← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5528: Visualizer plugin name encoding bug fixed.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 5528 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-12-21 21:37:22 +0100
message:
  Visualizer plugin name encoding bug fixed.
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/plugin/plugin.html
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.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-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-12-21 19:42:20 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js	2011-12-21 20:36:01 +0000
@@ -1144,13 +1144,12 @@
         data: [],        
         getData: function(exe) {
             this.data = [];
-console.log(DV.state.category.names);return;            
+            
             Ext.Array.each(DV.state.category.names, function(item) {
                 var obj = {};
                 obj[DV.conf.finals.chart.x] = item;
                 DV.chart.data.push(obj);
-            });     
-console.log(this.data);return;       
+            });
             
             Ext.Array.each(DV.chart.data, function(item) {
                 for (var i = 0; i < DV.state.series.names.length; i++) {
@@ -1168,7 +1167,6 @@
                     }
                 }
             });
-console.log(this.data);return;       
             
             if (exe) {
                 DV.store.getChartStore(true);

=== modified 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	2011-12-21 19:42:20 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.html	2011-12-21 20:36:01 +0000
@@ -36,7 +36,7 @@
 */
 			
 			DHIS.getChart({
-                indicators: [31664],
+                indicators: [31664, 32414],
 				organisationunits: [18],
 				el: 'chart1',
 				url: url

=== modified 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	2011-12-21 19:42:20 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.js	2011-12-21 20:36:01 +0000
@@ -375,7 +375,13 @@
                     if (!project.values.length) {
                         alert('No data values');
                         return;
-                    }                    
+                    }
+                    
+                    for (var i = 0; i < project.values.length; i++) {
+                        project.values[i][DHIS.conf.finals.dimension.data.value] = DHIS.util.string.getEncodedString(project.values[i][DHIS.conf.finals.dimension.data.value]);
+                        project.values[i][DHIS.conf.finals.dimension.period.value] = DHIS.util.string.getEncodedString(project.values[i][DHIS.conf.finals.dimension.period.value]);
+                        project.values[i][DHIS.conf.finals.dimension.organisationunit.value] = DHIS.util.string.getEncodedString(project.values[i][DHIS.conf.finals.dimension.organisationunit.value]);
+                    }                        
                     
                     Ext.Array.each(project.values, function(item) {
                         Ext.Array.include(project.state.series.names, DHIS.util.string.getEncodedString(item[project.state.series.dimension]));
@@ -401,14 +407,18 @@
     DHIS.chart = {
         getData: function(project) {
             project.data = [];
-//console.log(project.state.category.names);return;  
 			
             Ext.Array.each(project.state.category.names, function(item) {
                 var obj = {};
                 obj[DHIS.conf.finals.chart.x] = item;
                 project.data.push(obj);
             });
-//console.log(project.data);return;         
+            
+            Ext.Array.each(project.data, function(item) {
+                for (var i = 0; i < project.state.series.names.length; i++) {
+                    item[project.state.series.names[i]] = 0;
+                }
+            });
             
             Ext.Array.each(project.data, function(item) {
                 for (var i = 0; i < project.state.series.names.length; i++) {
@@ -420,7 +430,6 @@
                     }
                 }
             });
-//console.log(project.data);return;            
                 
 			DHIS.store.getChartStore(project);
         },