dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #37403
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19140: EV pie chart series names bug fixed.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 19140 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-05-12 14:09:45 +0200
message:
EV pie chart series names bug fixed.
modified:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/plugin.html
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/core.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/eventchart.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/chart.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/core.js
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/chart.js
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventchart.js
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/chart.js
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventchart.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-apps/src/main/webapp/dhis-web-event-visualizer/plugin.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/plugin.html 2015-05-08 01:05:08 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/plugin.html 2015-05-12 12:08:19 +0000
@@ -28,7 +28,7 @@
DHIS.getEventChart({
url: url,
el: 'report1',
- id: 'f8EXR8FTJNY'
+ id: 'CktahCZqrH6'
});
//DHIS.getEventChart({
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/core.js 2015-05-11 18:50:29 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/core.js 2015-05-12 12:01:58 +0000
@@ -3142,7 +3142,7 @@
// sort order
if (xLayout.sortOrder) {
var valueKey = isStacked ? dataTotalKey : failSafeColumnIds[0],
- sortKey = 'sorting_' + "sdklfjlsdkfjsdflk";
+ sortKey = 'sorting_' + Ext.data.IdGenerator.get('uuid').generate();
// create sort key
for (var ii = 0, rec; ii < data.length; ii++) {
@@ -3562,54 +3562,60 @@
return getValidatedTitles(titles, maxLength);
};
- getPieSeriesTitle = function(store) {
- var a = [];
-
- if (Ext.isObject(xLayout.legendStyle) && Ext.isArray(xLayout.legendStyle.labelNames)) {
- return xLayout.legendStyle.labelNames;
- }
- else {
- var id = store.domainFields[0];
-
- store.each( function(r) {
- a.push(r.data[id]);
-
- //if (Ext.isString(name) && Ext.isObject(xLayout.legendStyle) && Ext.isNumber(xLayout.legendStyle.labelMaxLength)) {
- //var mxl = parseInt(xLayout.legendStyle.labelMaxLength);
-
- //name = name.length > mxl ? name.substr(0, mxl) + '..' : name;
- //}
- });
- }
-
- return getFormatedSeriesTitle(a);
- };
-
getDefaultSeriesTitle = function(store) {
var a = [],
- md = xResponse.metaData;
+ md = xResponse.metaData,
+ ls = Ext.isObject(xLayout.legendStyle) ? xLayout.legendStyle : null;
- if (Ext.isObject(xLayout.legend) && Ext.isArray(xLayout.legend.seriesNames)) {
- return xLayout.legend.seriesNames;
+ if (ls && Ext.isArray(ls.labelNames)) {
+ return ls.labelNames;
}
else {
for (var i = 0, id, name, mxl, ids; i < store.rangeFields.length; i++) {
id = failSafeColumnIdMap[store.rangeFields[i]];
name = md.booleanNames[id] || md.optionNames[id] || md.names[id];
- if (Ext.isObject(xLayout.legend) && xLayout.legend.maxLength) {
- var mxl = parseInt(xLayout.legend.maxLength);
-
- if (Ext.isNumber(mxl)) {
- name = name.substr(0, mxl) + '..';
- }
- }
-
- a.push(name);
- }
- }
-
- return a;
+ if (ls && ls.labelMaxLength) {
+ var mxl = parseInt(ls.labelMaxLength);
+
+ if (Ext.isNumber(mxl)) {
+ name = name.substr(0, mxl) + '..';
+ }
+ }
+
+ a.push(name);
+ }
+ }
+
+ return getFormatedSeriesTitle(a);
+ };
+
+ getPieSeriesTitle = function(store) {
+ var a = [],
+ md = xResponse.metaData,
+ ls = Ext.isObject(xLayout.legendStyle) ? xLayout.legendStyle : null;
+
+ if (ls && Ext.isArray(ls.labelNames)) {
+ return ls.labelNames;
+ }
+ else {
+ for (var i = 0, id, name; i < rowIds.length; i++) {
+ id = rowIds[i];
+ name = md.booleanNames[id] || md.optionNames[id] || md.names[id] || id;
+
+ if (ls && ls.labelMaxLength) {
+ var mxl = parseInt(ls.labelMaxLength);
+
+ if (Ext.isNumber(mxl)) {
+ name = name.substr(0, mxl) + '..';
+ }
+ }
+
+ a.push(name);
+ }
+ }
+
+ return getFormatedSeriesTitle(a);
};
getDefaultSeries = function(store) {
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/eventchart.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/eventchart.js 2015-05-11 18:48:22 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/eventchart.js 2015-05-12 12:08:19 +0000
@@ -3225,7 +3225,7 @@
// sort order
if (xLayout.sortOrder) {
var valueKey = isStacked ? dataTotalKey : failSafeColumnIds[0],
- sortKey = 'sorting_' + "sdklfjlsdkfjsdflk";
+ sortKey = 'sorting_' + Ext.data.IdGenerator.get('uuid').generate();
// create sort key
for (var ii = 0, rec; ii < data.length; ii++) {
@@ -3645,54 +3645,60 @@
return getValidatedTitles(titles, maxLength);
};
- getPieSeriesTitle = function(store) {
- var a = [];
-
- if (Ext.isObject(xLayout.legendStyle) && Ext.isArray(xLayout.legendStyle.labelNames)) {
- return xLayout.legendStyle.labelNames;
- }
- else {
- var id = store.domainFields[0];
-
- store.each( function(r) {
- a.push(r.data[id]);
-
- //if (Ext.isString(name) && Ext.isObject(xLayout.legendStyle) && Ext.isNumber(xLayout.legendStyle.labelMaxLength)) {
- //var mxl = parseInt(xLayout.legendStyle.labelMaxLength);
-
- //name = name.length > mxl ? name.substr(0, mxl) + '..' : name;
- //}
- });
- }
-
- return getFormatedSeriesTitle(a);
- };
-
getDefaultSeriesTitle = function(store) {
var a = [],
- md = xResponse.metaData;
+ md = xResponse.metaData,
+ ls = Ext.isObject(xLayout.legendStyle) ? xLayout.legendStyle : null;
- if (Ext.isObject(xLayout.legend) && Ext.isArray(xLayout.legend.seriesNames)) {
- return xLayout.legend.seriesNames;
+ if (ls && Ext.isArray(ls.labelNames)) {
+ return ls.labelNames;
}
else {
for (var i = 0, id, name, mxl, ids; i < store.rangeFields.length; i++) {
id = failSafeColumnIdMap[store.rangeFields[i]];
name = md.booleanNames[id] || md.optionNames[id] || md.names[id];
- if (Ext.isObject(xLayout.legend) && xLayout.legend.maxLength) {
- var mxl = parseInt(xLayout.legend.maxLength);
-
- if (Ext.isNumber(mxl)) {
- name = name.substr(0, mxl) + '..';
- }
- }
-
- a.push(name);
- }
- }
-
- return a;
+ if (ls && ls.labelMaxLength) {
+ var mxl = parseInt(ls.labelMaxLength);
+
+ if (Ext.isNumber(mxl)) {
+ name = name.substr(0, mxl) + '..';
+ }
+ }
+
+ a.push(name);
+ }
+ }
+
+ return getFormatedSeriesTitle(a);
+ };
+
+ getPieSeriesTitle = function(store) {
+ var a = [],
+ md = xResponse.metaData,
+ ls = Ext.isObject(xLayout.legendStyle) ? xLayout.legendStyle : null;
+
+ if (ls && Ext.isArray(ls.labelNames)) {
+ return ls.labelNames;
+ }
+ else {
+ for (var i = 0, id, name; i < rowIds.length; i++) {
+ id = rowIds[i];
+ name = md.booleanNames[id] || md.optionNames[id] || md.names[id] || id;
+
+ if (ls && ls.labelMaxLength) {
+ var mxl = parseInt(ls.labelMaxLength);
+
+ if (Ext.isNumber(mxl)) {
+ name = name.substr(0, mxl) + '..';
+ }
+ }
+
+ a.push(name);
+ }
+ }
+
+ return getFormatedSeriesTitle(a);
};
getDefaultSeries = function(store) {
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/chart.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/chart.js 2015-05-11 13:01:12 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/chart.js 2015-05-12 12:08:19 +0000
@@ -2568,7 +2568,7 @@
// sort order
if (xLayout.sortOrder) {
var valueKey = isStacked ? dataTotalKey : failSafeColumnIds[0],
- sortKey = 'sorting_' + "sdklfjlsdkfjsdflk";
+ sortKey = 'sorting_' + Ext.data.IdGenerator.get('uuid').generate();
// create sort key
for (var ii = 0, rec; ii < data.length; ii++) {
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/core.js 2015-05-11 13:01:12 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/core.js 2015-05-12 12:01:58 +0000
@@ -2511,7 +2511,7 @@
// sort order
if (xLayout.sortOrder) {
var valueKey = isStacked ? dataTotalKey : failSafeColumnIds[0],
- sortKey = 'sorting_' + "sdklfjlsdkfjsdflk";
+ sortKey = 'sorting_' + Ext.data.IdGenerator.get('uuid').generate();
// create sort key
for (var ii = 0, rec; ii < data.length; ii++) {
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/chart.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/chart.js 2015-05-11 13:01:12 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/chart.js 2015-05-12 12:08:19 +0000
@@ -2568,7 +2568,7 @@
// sort order
if (xLayout.sortOrder) {
var valueKey = isStacked ? dataTotalKey : failSafeColumnIds[0],
- sortKey = 'sorting_' + "sdklfjlsdkfjsdflk";
+ sortKey = 'sorting_' + Ext.data.IdGenerator.get('uuid').generate();
// create sort key
for (var ii = 0, rec; ii < data.length; ii++) {
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventchart.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventchart.js 2015-05-11 18:48:22 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventchart.js 2015-05-12 12:08:19 +0000
@@ -3225,7 +3225,7 @@
// sort order
if (xLayout.sortOrder) {
var valueKey = isStacked ? dataTotalKey : failSafeColumnIds[0],
- sortKey = 'sorting_' + "sdklfjlsdkfjsdflk";
+ sortKey = 'sorting_' + Ext.data.IdGenerator.get('uuid').generate();
// create sort key
for (var ii = 0, rec; ii < data.length; ii++) {
@@ -3645,54 +3645,60 @@
return getValidatedTitles(titles, maxLength);
};
- getPieSeriesTitle = function(store) {
- var a = [];
-
- if (Ext.isObject(xLayout.legendStyle) && Ext.isArray(xLayout.legendStyle.labelNames)) {
- return xLayout.legendStyle.labelNames;
- }
- else {
- var id = store.domainFields[0];
-
- store.each( function(r) {
- a.push(r.data[id]);
-
- //if (Ext.isString(name) && Ext.isObject(xLayout.legendStyle) && Ext.isNumber(xLayout.legendStyle.labelMaxLength)) {
- //var mxl = parseInt(xLayout.legendStyle.labelMaxLength);
-
- //name = name.length > mxl ? name.substr(0, mxl) + '..' : name;
- //}
- });
- }
-
- return getFormatedSeriesTitle(a);
- };
-
getDefaultSeriesTitle = function(store) {
var a = [],
- md = xResponse.metaData;
+ md = xResponse.metaData,
+ ls = Ext.isObject(xLayout.legendStyle) ? xLayout.legendStyle : null;
- if (Ext.isObject(xLayout.legend) && Ext.isArray(xLayout.legend.seriesNames)) {
- return xLayout.legend.seriesNames;
+ if (ls && Ext.isArray(ls.labelNames)) {
+ return ls.labelNames;
}
else {
for (var i = 0, id, name, mxl, ids; i < store.rangeFields.length; i++) {
id = failSafeColumnIdMap[store.rangeFields[i]];
name = md.booleanNames[id] || md.optionNames[id] || md.names[id];
- if (Ext.isObject(xLayout.legend) && xLayout.legend.maxLength) {
- var mxl = parseInt(xLayout.legend.maxLength);
-
- if (Ext.isNumber(mxl)) {
- name = name.substr(0, mxl) + '..';
- }
- }
-
- a.push(name);
- }
- }
-
- return a;
+ if (ls && ls.labelMaxLength) {
+ var mxl = parseInt(ls.labelMaxLength);
+
+ if (Ext.isNumber(mxl)) {
+ name = name.substr(0, mxl) + '..';
+ }
+ }
+
+ a.push(name);
+ }
+ }
+
+ return getFormatedSeriesTitle(a);
+ };
+
+ getPieSeriesTitle = function(store) {
+ var a = [],
+ md = xResponse.metaData,
+ ls = Ext.isObject(xLayout.legendStyle) ? xLayout.legendStyle : null;
+
+ if (ls && Ext.isArray(ls.labelNames)) {
+ return ls.labelNames;
+ }
+ else {
+ for (var i = 0, id, name; i < rowIds.length; i++) {
+ id = rowIds[i];
+ name = md.booleanNames[id] || md.optionNames[id] || md.names[id] || id;
+
+ if (ls && ls.labelMaxLength) {
+ var mxl = parseInt(ls.labelMaxLength);
+
+ if (Ext.isNumber(mxl)) {
+ name = name.substr(0, mxl) + '..';
+ }
+ }
+
+ a.push(name);
+ }
+ }
+
+ return getFormatedSeriesTitle(a);
};
getDefaultSeries = function(store) {
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/chart.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/chart.js 2015-05-11 13:01:12 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/chart.js 2015-05-12 12:08:19 +0000
@@ -2568,7 +2568,7 @@
// sort order
if (xLayout.sortOrder) {
var valueKey = isStacked ? dataTotalKey : failSafeColumnIds[0],
- sortKey = 'sorting_' + "sdklfjlsdkfjsdflk";
+ sortKey = 'sorting_' + Ext.data.IdGenerator.get('uuid').generate();
// create sort key
for (var ii = 0, rec; ii < data.length; ii++) {
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventchart.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventchart.js 2015-05-11 18:48:22 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventchart.js 2015-05-12 12:08:19 +0000
@@ -3225,7 +3225,7 @@
// sort order
if (xLayout.sortOrder) {
var valueKey = isStacked ? dataTotalKey : failSafeColumnIds[0],
- sortKey = 'sorting_' + "sdklfjlsdkfjsdflk";
+ sortKey = 'sorting_' + Ext.data.IdGenerator.get('uuid').generate();
// create sort key
for (var ii = 0, rec; ii < data.length; ii++) {
@@ -3645,54 +3645,60 @@
return getValidatedTitles(titles, maxLength);
};
- getPieSeriesTitle = function(store) {
- var a = [];
-
- if (Ext.isObject(xLayout.legendStyle) && Ext.isArray(xLayout.legendStyle.labelNames)) {
- return xLayout.legendStyle.labelNames;
- }
- else {
- var id = store.domainFields[0];
-
- store.each( function(r) {
- a.push(r.data[id]);
-
- //if (Ext.isString(name) && Ext.isObject(xLayout.legendStyle) && Ext.isNumber(xLayout.legendStyle.labelMaxLength)) {
- //var mxl = parseInt(xLayout.legendStyle.labelMaxLength);
-
- //name = name.length > mxl ? name.substr(0, mxl) + '..' : name;
- //}
- });
- }
-
- return getFormatedSeriesTitle(a);
- };
-
getDefaultSeriesTitle = function(store) {
var a = [],
- md = xResponse.metaData;
+ md = xResponse.metaData,
+ ls = Ext.isObject(xLayout.legendStyle) ? xLayout.legendStyle : null;
- if (Ext.isObject(xLayout.legend) && Ext.isArray(xLayout.legend.seriesNames)) {
- return xLayout.legend.seriesNames;
+ if (ls && Ext.isArray(ls.labelNames)) {
+ return ls.labelNames;
}
else {
for (var i = 0, id, name, mxl, ids; i < store.rangeFields.length; i++) {
id = failSafeColumnIdMap[store.rangeFields[i]];
name = md.booleanNames[id] || md.optionNames[id] || md.names[id];
- if (Ext.isObject(xLayout.legend) && xLayout.legend.maxLength) {
- var mxl = parseInt(xLayout.legend.maxLength);
-
- if (Ext.isNumber(mxl)) {
- name = name.substr(0, mxl) + '..';
- }
- }
-
- a.push(name);
- }
- }
-
- return a;
+ if (ls && ls.labelMaxLength) {
+ var mxl = parseInt(ls.labelMaxLength);
+
+ if (Ext.isNumber(mxl)) {
+ name = name.substr(0, mxl) + '..';
+ }
+ }
+
+ a.push(name);
+ }
+ }
+
+ return getFormatedSeriesTitle(a);
+ };
+
+ getPieSeriesTitle = function(store) {
+ var a = [],
+ md = xResponse.metaData,
+ ls = Ext.isObject(xLayout.legendStyle) ? xLayout.legendStyle : null;
+
+ if (ls && Ext.isArray(ls.labelNames)) {
+ return ls.labelNames;
+ }
+ else {
+ for (var i = 0, id, name; i < rowIds.length; i++) {
+ id = rowIds[i];
+ name = md.booleanNames[id] || md.optionNames[id] || md.names[id] || id;
+
+ if (ls && ls.labelMaxLength) {
+ var mxl = parseInt(ls.labelMaxLength);
+
+ if (Ext.isNumber(mxl)) {
+ name = name.substr(0, mxl) + '..';
+ }
+ }
+
+ a.push(name);
+ }
+ }
+
+ return getFormatedSeriesTitle(a);
};
getDefaultSeries = function(store) {