From: Evert Timberg Date: Fri, 19 Jun 2015 23:13:31 +0000 (-0400) Subject: Fix a missing `this` in the scale `generateTicks` method when manually overriding... X-Git-Tag: 2.0.0-alpha4~69^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dd49f0c9217759e7e670d69c82e77c7a043dbdb;p=thirdparty%2FChart.js.git Fix a missing `this` in the scale `generateTicks` method when manually overriding. Added a sample to test this. --- diff --git a/samples/line-scale-override.html b/samples/line-scale-override.html new file mode 100644 index 000000000..6603b5c04 --- /dev/null +++ b/samples/line-scale-override.html @@ -0,0 +1,131 @@ + + + + + Line Chart with Scale Override + + + + + +
+ +
+
+
+ + + + + + + + + diff --git a/src/scales/scale.linear.js b/src/scales/scale.linear.js index 21a6e4322..ceeae97c1 100644 --- a/src/scales/scale.linear.js +++ b/src/scales/scale.linear.js @@ -61,7 +61,7 @@ // we get the final line for (var i = 0; i <= this.options.override.steps; ++i) { var value = this.options.override.start + (i * this.options.override.stepWidth); - ticks.push(value); + this.ticks.push(value); } } else { // Figure out what the max number of ticks we can support it is based on the size of diff --git a/src/scales/scale.radialLinear.js b/src/scales/scale.radialLinear.js index 0a1a26b45..0e9c763b3 100644 --- a/src/scales/scale.radialLinear.js +++ b/src/scales/scale.radialLinear.js @@ -129,7 +129,7 @@ // we get the final line for (var i = 0; i <= this.options.override.steps; ++i) { var value = this.options.override.start + (i * this.options.override.stepWidth); - ticks.push(value); + this.ticks.push(value); } } else { // Figure out what the max number of ticks we can support it is based on the size of