Skip to content

Commit

Permalink
Fix #46 Line Chart - empty values are rendered as 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelte Lagendijk committed May 10, 2017
1 parent 26672c4 commit 4a67b7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ChartJS/widgets/LineChart/widget/LineChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ define([
xlabels.push(((this.scaleShowLabelsBottom === true) ? set.points[i].get(this.seriesxlabel) : ""));
}

points.push(+(set.points[i].get(this.seriesylabel))); // Convert to integer, so the stackedbar doesnt break!
var pointvalue = set.points[i].get(this.seriesylabel);
if (pointvalue === "") {
points.push(null);
} else {
points.push(+pointvalue); // Convert to number, so the stackedbar doesnt break!
}
//points.push(+(set.points[i].get(this.seriesylabel))); // Convert to integer, so the stackedbar doesnt break!

}

if (!xlabelsSet) {
Expand Down
Binary file modified test/widgets/ChartJS.mpk
Binary file not shown.

0 comments on commit 4a67b7e

Please sign in to comment.