dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17206
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6772: (DV plugin) Series data tooltip added.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 6772 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-04-26 23:03:03 +0000
message:
(DV plugin) Series data tooltip added.
modified:
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-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-04-26 21:27:41 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/index.html 2012-04-26 22:58:36 +0000
@@ -2,7 +2,7 @@
<head>
<link rel="stylesheet" type="text/css" href="http://extjs-public.googlecode.com/svn/tags/extjs-4.0.7/release/resources/css/ext-all-gray.css" />
<script type="text/javascript" src="http://extjs-public.googlecode.com/svn/tags/extjs-4.0.7/release/ext-all.js"></script>
- <script type="text/javascript" src="http://apps.dhis2.org/demo/dhis-web-visualizer/app/plugin/plugin.js"></script>
+ <script type="text/javascript" src="plugin.js"></script>
<style>
body {margin: 0 0 0 60px;}
@@ -44,18 +44,18 @@
<script>
Ext.onReady( function() {
- var url = 'http://apps.dhis2.org/dev/';
-
- DHIS.getChart({
- uid: 'EbRN2VIbPdV',
- el: 'chart1',
- url: url
- });
-
- DHIS.getChart({
- type: 'stackedcolumn',
- indicators: ['Uvn6LCg7dVU', 'OdiHJayrsKo'],
- periods: 'last12Months',
+ var url = '../../../'; // http://apps.dhis2.org/dev/
+
+ DHIS.getChart({
+ uid: 'gnymLKrv6l8',
+ el: 'chart1',
+ url: url
+ });
+
+ DHIS.getChart({
+ type: 'stackedcolumn',
+ indicators: ['Uvn6LCg7dVU', 'OdiHJayrsKo'],
+ periods: 'last12Months',
organisationunits: ['ImspTQPwCqd'],
el: 'chart2',
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 2012-04-26 19:33:25 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.js 2012-04-26 22:55:53 +0000
@@ -159,8 +159,9 @@
getTips: function() {
return {
trackMouse: true,
- height: 31,
- renderer: function(item) {
+ style: 'border-width:2px; background-color:#eee',
+ renderer: function(r, item) {
+ this.update('<span style="font-size:22px">' + item.value[1] + '</span>');
}
};
},
@@ -202,7 +203,8 @@
type: 'line',
axis: 'left',
xField: project.store.bottom,
- yField: project.store.left[i]
+ yField: project.store.left[i],
+ tips: DHIS.util.chart.getTips()
});
}
return a;
@@ -233,13 +235,12 @@
}
];
},
- getTips: function() {
+ getTips: function(left) {
return {
trackMouse: true,
- height: 47,
+ style: 'border-width:2px; background-color:#eee',
renderer: function(item) {
- this.setWidth((item.data.x.length * 8) + 15);
- this.setTitle('<span class="dv-chart-tips">' + item.data.x + '<br/><b>' + item.data[DHIS.store.left[0]] + '</b></span>');
+ this.update('<span style="font-size:14px">' + item.data.x + '<br/><b>' + item.data[left] + '</b></span>');
}
};
}
@@ -422,7 +423,6 @@
params = params.concat(DHIS.util.dimension[project.state.series.dimension].getUrl());
params = params.concat(DHIS.util.dimension[project.state.category.dimension].getUrl());
params = params.concat(DHIS.util.dimension[project.state.filter.dimension].getUrl(true));
-console.log(params);
var baseUrl = DHIS.util.string.extendUrl(project.state.conf.url) + DHIS.conf.finals.ajax.data_get;
Ext.Array.each(params, function(item) {
@@ -539,7 +539,8 @@
stacked: isStacked,
style: {
opacity: 0.8
- }
+ },
+ tips: DHIS.util.chart.getTips()
}
]
});
@@ -585,7 +586,8 @@
stacked: isStacked,
style: {
opacity: 0.8
- }
+ },
+ tips: DHIS.util.chart.getTips()
}
]
});
@@ -668,7 +670,6 @@
DHIS.projects.push(project);
},
pie: function(project) {
-console.log(project.state);
project.chart = Ext.create('Ext.chart.Chart', {
renderTo: project.state.conf.el,
width: project.state.conf.width || this.el.getWidth(),
@@ -683,7 +684,6 @@
type: 'pie',
field: project.store.left[0],
showInLegend: true,
- tips: DHIS.util.chart.pie.getTips(),
label: {
field: project.store.bottom[0]
},
@@ -694,7 +694,8 @@
},
style: {
opacity: 0.9
- }
+ },
+ tips: DHIS.util.chart.pie.getTips(project.store.left[0])
}]
});