dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #22811
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11088: (DV) Pie chart legend fixes + i18n.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 11088 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-05-29 18:23:34 +0200
message:
(DV) Pie chart legend fixes + i18n.
modified:
dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module.properties
dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module_fr_FR.properties
dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js
dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/core.js
dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/i18n.vm
--
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/resources/org/hisp/dhis/visualizer/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module.properties 2013-05-29 15:03:05 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module.properties 2013-05-29 15:57:30 +0000
@@ -194,4 +194,5 @@
detailed_data_elements_cannot_be_specified_as_filter=Detailed data elements cannot be specified as filter
plain_data_sources=Plain data source
graphics=Graphics
-write_your_interpretation=Write a comment, question or interpretation
\ No newline at end of file
+write_your_interpretation=Write a comment, question or interpretation
+sharing_settings=Sharing settings
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module_fr_FR.properties'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module_fr_FR.properties 2013-05-29 14:14:12 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module_fr_FR.properties 2013-05-29 15:57:30 +0000
@@ -173,4 +173,5 @@
add_new=Ajouter nouveau
create=Cr\u00E9er
plain_data_sources=Source de donn\u00E9es simples
-graphics=Graphique
\ No newline at end of file
+graphics=Graphique
+sharing_settings=Param\u00E8tres de partage
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js 2013-05-29 15:03:05 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js 2013-05-29 15:57:30 +0000
@@ -1819,7 +1819,7 @@
}
window = Ext.create('Ext.window.Window', {
- title: 'Sharing layout',
+ title: DV.i18n.sharing_settings,
bodyStyle: 'padding:6px 6px 0px; background-color:#fff',
resizable: false,
modal: true,
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/core.js 2013-05-29 14:49:31 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/core.js 2013-05-29 16:21:49 +0000
@@ -1201,10 +1201,10 @@
});
};
- getDefaultLegend = function(store, xResponse) {
+ getDefaultLegend = function(store, xLayout, xResponse) {
var itemLength = 30,
charLength = 7,
- numberOfItems = store.rangeFields.length,
+ numberOfItems,
numberOfChars = 0,
str = '',
width,
@@ -1212,21 +1212,32 @@
position = 'top',
padding = 0;
- for (var i = 0, name, ids; i < store.rangeFields.length; i++) {
- if (store.rangeFields[i].indexOf('-') !== -1) {
- ids = store.rangeFields[i].split('-');
- name = xResponse.metaData.names[ids[0]] + ' ' + xResponse.metaData.names[ids[1]];
- }
- else {
- name = xResponse.metaData.names[store.rangeFields[i]];
- }
-
- str += name;
+ if (xLayout.type === dv.conf.finals.chart.pie) {
+ numberOfItems = store.getCount();
+ store.each(function(r) {
+ str += r.data[store.domainFields[0]];
+ });
+ }
+ else {
+ numberOfItems = store.rangeFields.length;
+
+ for (var i = 0, name, ids; i < store.rangeFields.length; i++) {
+ if (store.rangeFields[i].indexOf('-') !== -1) {
+ ids = store.rangeFields[i].split('-');
+ name = xResponse.metaData.names[ids[0]] + ' ' + xResponse.metaData.names[ids[1]];
+ }
+ else {
+ name = xResponse.metaData.names[store.rangeFields[i]];
+ }
+
+ str += name;
+ }
}
numberOfChars = str.length;
width = (numberOfItems * itemLength) + (numberOfChars * charLength);
+//alert(width + ' > ' + dv.viewport.centerRegion.getWidth() + '\n' + str);
if (width > dv.viewport.centerRegion.getWidth() - 50) {
isVertical = true;
@@ -1329,7 +1340,7 @@
// Legend
if (!xLayout.hideLegend) {
- config.legend = getDefaultLegend(store, xResponse);
+ config.legend = getDefaultLegend(store, xLayout, xResponse);
if (config.legend.position === 'right') {
config.insetPadding = 40;
@@ -1646,10 +1657,9 @@
// Chart
chart = getDefaultChart(store, null, series, xResponse, xLayout);
- chart.legend.position = 'right';
- chart.legend.isVertical = true;
- chart.insetPadding = 20;
- chart.padding = '20 0 20 20';
+ //chart.legend.position = 'right';
+ //chart.legend.isVertical = true;
+ chart.insetPadding = 40;
chart.shadow = true;
return chart;
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/i18n.vm'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/i18n.vm 2013-05-28 14:37:50 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/i18n.vm 2013-05-29 15:57:30 +0000
@@ -193,5 +193,6 @@
public_access: '$encoder.jsEscape($i18n.getString( 'public_access' ) , "'")',
detailed_data_elements_cannot_be_specified_as_filter: '$encoder.jsEscape($i18n.getString( 'detailed_data_elements_cannot_be_specified_as_filter' ) , "'")',
plain_data_sources: '$encoder.jsEscape($i18n.getString( 'plain_data_sources' ) , "'")',
- graphics: '$encoder.jsEscape($i18n.getString( 'graphics' ) , "'")'
+ graphics: '$encoder.jsEscape($i18n.getString( 'graphics' ) , "'")',
+ sharing_settings: '$encoder.jsEscape($i18n.getString( 'sharing_settings' ) , "'")',
};