← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6983: Fixed bug in chart plugin

 

------------------------------------------------------------
revno: 6983
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-05-18 00:04:22 +0200
message:
  Fixed bug in chart plugin
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/plugin.js
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/index.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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/plugin.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/plugin.js	2012-05-16 21:52:29 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/plugin.js	2012-05-17 22:04:22 +0000
@@ -754,7 +754,7 @@
             params = params.concat(DHIS.chart.util.dimension[project.state.filter.dimension].getUrl(true));
                         
             var baseUrl = DHIS.chart.util.string.extendUrl(project.state.conf.url) + DHIS.chart.conf.finals.ajax.data_get;
-            baseUrl = DHIS.chart.util.string.appendUrlIfTrue(baseUrl, DHIS.chart.conf.finals.chart.orgUnitIsParent, project.state.orgUnitIsParent);
+            baseUrl = DHIS.chart.util.string.appendUrlIfTrue(baseUrl, DHIS.chart.conf.finals.chart.orgUnitIsParent, project.state.conf.orgUnitIsParent);
             
             Ext.Array.each(params, function(item) {
                 baseUrl = Ext.String.urlAppend(baseUrl, item);

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/index.html'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/index.html	2012-05-16 21:52:29 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/index.html	2012-05-17 22:04:22 +0000
@@ -11,9 +11,9 @@
 		
 		h1 {font-size: 20px; margin: 20px 0;}
 		
-		#chart1, #chart2, #table1, #table2 {width: 1000px; margin-bottom: 50px;}
+		#chart1, #chart2, #chart3, #table1, #table2 {width: 1000px; margin-bottom: 50px;}
 		
-		#chart1, #chart2 {height: 400px; border: 2px solid #d1d1d1; border-radius: 3px;}
+		#chart1, #chart2, #chart3 {height: 400px; border: 2px solid #d1d1d1; border-radius: 3px;}
 		
 		table {border-collapse: collapse;}
 		
@@ -52,6 +52,26 @@
 				url: url
 			});
 			
+			DHIS.getChart({
+				type: 'stackedcolumn',
+				indicators: ['Uvn6LCg7dVU'],
+				periods: 'thisYear',
+				category: 'organisationunit',
+				filter: 'period',
+				organisationunits: ['ImspTQPwCqd'],
+				orgUnitIsParent: true,
+				showData: true,
+				trendLine: true,
+				hideLegend: false,
+				hideSubtitle: false,
+				targetLineValue: 80,
+				targetLineLabel: null,				
+				baseLineValue: 20,
+				baseLineLabel: null,	
+				el: 'chart3',
+				url: url
+			});
+			
 			DHIS.getTable({
 				indicators: ['Uvn6LCg7dVU'],
 				periods: ['last12Months'],
@@ -126,6 +146,9 @@
     <h1>My chart 2</h1>
 	<div id="chart2"></div>
 	
+    <h1>My chart 3</h1>
+	<div id="chart3"></div>
+	
 	<h1>My table 1</h1>
 	<div id="table1"></div>
 		

=== 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	2012-05-16 21:52:29 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.js	2012-05-17 22:04:22 +0000
@@ -754,7 +754,7 @@
             params = params.concat(DHIS.chart.util.dimension[project.state.filter.dimension].getUrl(true));
                         
             var baseUrl = DHIS.chart.util.string.extendUrl(project.state.conf.url) + DHIS.chart.conf.finals.ajax.data_get;
-            baseUrl = DHIS.chart.util.string.appendUrlIfTrue(baseUrl, DHIS.chart.conf.finals.chart.orgUnitIsParent, project.state.orgUnitIsParent);
+            baseUrl = DHIS.chart.util.string.appendUrlIfTrue(baseUrl, DHIS.chart.conf.finals.chart.orgUnitIsParent, project.state.conf.orgUnitIsParent);
             
             Ext.Array.each(params, function(item) {
                 baseUrl = Ext.String.urlAppend(baseUrl, item);