Skip to content

Commit b1500bc

Browse files
author
Jelte Lagendijk
committed
Fix ChartJS scales property
1 parent 828e8e1 commit b1500bc

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

src/ChartJS/widgets/LineChart/widget/LineChart.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,6 @@ define([
123123
type: "line",
124124
data: data,
125125
options: {
126-
scales : {
127-
yAxes: [{
128-
//If stacked is set to true, the Y-axis needs to be stacked for it to work
129-
stacked: this.isStacked
130-
}]
131-
},
132126

133127
responsive : this.responsive,
134128
responsiveAnimationDuration : (this.responsiveAnimationDuration > 0 ? this.responsiveAnimationDuration : 0),
@@ -205,14 +199,17 @@ define([
205199
id: "x-axis-0"
206200
}],
207201
yAxes: [{
208-
ticks:{
209-
callback: lang.hitch(this, function(value){
210-
var round = parseInt(this.roundY);
211-
if (!isNaN(round) && round >= 0) {
212-
return Number(value).toFixed(round);
213-
}
214-
return value;
215-
})},
202+
//If stacked is set to true, the Y-axis needs to be stacked for it to work
203+
stacked: this.isStacked,
204+
ticks:{
205+
callback: lang.hitch(this, function(value){
206+
var round = parseInt(this.roundY);
207+
if (!isNaN(round) && round >= 0) {
208+
return Number(value).toFixed(round);
209+
}
210+
return value;
211+
})
212+
},
216213
type: "linear",
217214
id: "y-axis-0"
218215
}],

test/[Test] ChartJS.mpr

4 KB
Binary file not shown.

test/widgets/ChartJS.mpk

179 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)