From 2dd49f0c9217759e7e670d69c82e77c7a043dbdb Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Fri, 19 Jun 2015 19:13:31 -0400 Subject: [PATCH] Fix a missing `this` in the scale `generateTicks` method when manually overriding. Added a sample to test this. --- samples/line-scale-override.html | 131 +++++++++++++++++++++++++++++++ src/scales/scale.linear.js | 2 +- src/scales/scale.radialLinear.js | 2 +- 3 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 samples/line-scale-override.html 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