From dff7281bd06fdc23d626589ae67fda20de3f72b7 Mon Sep 17 00:00:00 2001 From: Jelte Lagendijk Date: Tue, 17 Oct 2017 14:26:06 +0200 Subject: [PATCH] Possible fix --- package.json | 2 +- .../widgets/BarChart/widget/BarChart.js | 9 +++++++-- test/widgets/ChartJS.mpk | Bin 349369 -> 349429 bytes 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f5e1f72..1652c88 100644 --- a/package.json +++ b/package.json @@ -35,4 +35,4 @@ "folders": "node ./node_modules/gulp/bin/gulp folders", "modeler": "node ./node_modules/gulp/bin/gulp modeler" } -} \ No newline at end of file +} diff --git a/src/ChartJS/widgets/BarChart/widget/BarChart.js b/src/ChartJS/widgets/BarChart/widget/BarChart.js index 5bf5578..f7e2f82 100644 --- a/src/ChartJS/widgets/BarChart/widget/BarChart.js +++ b/src/ChartJS/widgets/BarChart/widget/BarChart.js @@ -12,6 +12,7 @@ define([ _processData : function () { logger.debug(this.id + "._processData"); + console.log(this); var sets = [], points = null, set = { @@ -58,8 +59,12 @@ define([ label = set.dataset.get(this.datasetlabel); for (i = 0; i < set.points.length; i++) { - if (!xlabelsSet) { - xlabels.push(((this.scaleShowLabelsBottom === true) ? set.points[i].get(this.seriesxlabel) : "")); + var xlabel = ((this.scaleShowLabelsBottom === true) ? set.points[i].get(this.seriesxlabel) : ""); + // if (!xlabelsSet) { + // xlabels.push(xlabel); + // } + if ("" !== xlabel && -1 === xlabels.indexOf(xlabel)) { + xlabels.push(xlabel); } points.push(+(set.points[i].get(this.seriesylabel))); // Convert to integer, so the stackedbar doesnt break! diff --git a/test/widgets/ChartJS.mpk b/test/widgets/ChartJS.mpk index de86e40cc7d2989ab1cbb5c529e27f02432c8723..543f3ba9a5bab6af8eeebf3239de6eba3c3695aa 100644 GIT binary patch delta 2579 zcmY+GdpMM7AIIl(Cx)59U=0Z|ITUKA#vz(9hG87Wl;qTIghJYNh=d76&RKC&&d~^w z#0W{R9E*+)y-G@!bg+w3t)_j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