From 2b7421d52fb1e70b7263c5a2467665d49dcd95e1 Mon Sep 17 00:00:00 2001 From: J Copperfield Date: Wed, 1 Nov 2017 16:11:51 +0100 Subject: [PATCH 1/5] Fix for issues #3917, #4380, #2966 - issue #3917: Logarithmic Scale Tick Bug for values of 0 - issue #4380: LogLog plots are impossible (0, 0) - issue #2966: chart does not render if data contains value of 0 when using logarithmic scale --- src/scales/scale.logarithmic.js | 116 ++++++++++++++++---------- test/specs/scale.logarithmic.tests.js | 14 ++-- 2 files changed, 82 insertions(+), 48 deletions(-) diff --git a/src/scales/scale.logarithmic.js b/src/scales/scale.logarithmic.js index 78aaf8171c4..beffede32e5 100644 --- a/src/scales/scale.logarithmic.js +++ b/src/scales/scale.logarithmic.js @@ -179,62 +179,94 @@ module.exports = function(Chart) { }, getPixelForValue: function(value) { var me = this; - var start = me.start; - var newVal = +me.getRightValue(value); - var opts = me.options; - var tickOpts = opts.ticks; - var innerDimension, pixel, range; + var realValue = +me.getRightValue(value); + var reverse = me.options.ticks.reverse; + var lg = helpers.log10; + var exp = Math.floor(lg(me.minNotZero)); + var significand = Math.floor(me.minNotZero / Math.pow(10, exp)); + var firstTickValue = significand * Math.pow(10, exp); + var offset = 0; + var baseValue, innerDimension, pixel, range, sign; + if (reverse) { + range = { + start: me.end, + end: me.start + }; + sign = -1; + } else { + range = { + start: me.start, + end: me.end + }; + sign = 1; + } + baseValue = range.start; if (me.isHorizontal()) { - range = helpers.log10(me.end) - helpers.log10(start); // todo: if start === 0 - if (newVal === 0) { - pixel = me.left; - } else { - innerDimension = me.width; - pixel = me.left + (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start))); - } + innerDimension = me.width; + pixel = (reverse) + ? me.right + : me.left; } else { - // Bottom - top since pixels increase downward on a screen innerDimension = me.height; - if (start === 0 && !tickOpts.reverse) { - range = helpers.log10(me.end) - helpers.log10(me.minNotZero); - if (newVal === start) { - pixel = me.bottom; - } else if (newVal === me.minNotZero) { - pixel = me.bottom - innerDimension * 0.02; - } else { - pixel = me.bottom - innerDimension * 0.02 - (innerDimension * 0.98 / range * (helpers.log10(newVal) - helpers.log10(me.minNotZero))); - } - } else if (me.end === 0 && tickOpts.reverse) { - range = helpers.log10(me.start) - helpers.log10(me.minNotZero); - if (newVal === me.end) { - pixel = me.top; - } else if (newVal === me.minNotZero) { - pixel = me.top + innerDimension * 0.02; - } else { - pixel = me.top + innerDimension * 0.02 + (innerDimension * 0.98 / range * (helpers.log10(newVal) - helpers.log10(me.minNotZero))); - } - } else if (newVal === 0) { - pixel = tickOpts.reverse ? me.top : me.bottom; - } else { - range = helpers.log10(me.end) - helpers.log10(start); - innerDimension = me.height; - pixel = me.bottom - (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start))); + sign *= -1; // invert, since the upper-left corner of the canvas is at pixel (0, 0) + pixel = (reverse) + ? me.top + : me.bottom; + } + if (realValue !== baseValue) { + if (baseValue === 0) { // include zero tick + offset = helpers.getValueOrDefault( + me.options.ticks.fontSize, + Chart.defaults.global.defaultFontSize + ); + innerDimension -= offset; + range.start = firstTickValue; + } + if (realValue !== 0) { + offset += innerDimension / (lg(range.end) - lg(range.start)) * (lg(realValue) - lg(range.start)); } + pixel += sign * offset; } return pixel; }, getValueForPixel: function(pixel) { var me = this; - var range = helpers.log10(me.end) - helpers.log10(me.start); - var value, innerDimension; + var reverse = me.options.ticks.reverse; + var lg = helpers.log10; + var exp = Math.floor(lg(me.minNotZero)); + var significand = Math.floor(me.minNotZero / Math.pow(10, exp)); + var firstTickValue = significand * Math.pow(10, exp); + var range = (reverse) + ? {start: me.end, end: me.start} + : {start: me.start, end: me.end}; + var baseValue = range.start; + var innerDimension, value; if (me.isHorizontal()) { innerDimension = me.width; - value = me.start * Math.pow(10, (pixel - me.left) * range / innerDimension); - } else { // todo: if start === 0 + value = (reverse) + ? me.right - pixel + : pixel - me.left; + } else { innerDimension = me.height; - value = Math.pow(10, (me.bottom - pixel) * range / innerDimension) / me.start; + value = (reverse) + ? pixel - me.top + : me.bottom - pixel; + } + if (value !== baseValue) { + if (baseValue === 0) { // include zero tick + var offset = helpers.getValueOrDefault( + me.options.ticks.fontSize, + Chart.defaults.global.defaultFontSize + ); + value -= offset; + innerDimension -= offset; + range.start = firstTickValue; + } + value *= lg(range.end) - lg(range.start); + value /= innerDimension; + value = Math.pow(10, lg(range.start) + value); } return value; } diff --git a/test/specs/scale.logarithmic.tests.js b/test/specs/scale.logarithmic.tests.js index 9640b1d3d62..0367ce46414 100644 --- a/test/specs/scale.logarithmic.tests.js +++ b/test/specs/scale.logarithmic.tests.js @@ -761,9 +761,10 @@ describe('Logarithmic Scale tests', function() { var yScale = chart.scales.yScale; expect(yScale.getPixelForValue(70, 0, 0)).toBeCloseToPixel(32); // top + paddingTop expect(yScale.getPixelForValue(0, 0, 0)).toBeCloseToPixel(484); // bottom - paddingBottom - expect(yScale.getPixelForValue(0.063, 0, 0)).toBeCloseToPixel(475); // minNotZero 2% from range - expect(yScale.getPixelForValue(0.5, 0, 0)).toBeCloseToPixel(344); - expect(yScale.getPixelForValue(4, 0, 0)).toBeCloseToPixel(213); + expect(yScale.getPixelForValue(0.06, 0, 0)).toBeCloseToPixel(472); // first tick fontsize from 0 + expect(yScale.getPixelForValue(0.063, 0, 0)).toBeCloseToPixel(469); // minNotZero + expect(yScale.getPixelForValue(0.5, 0, 0)).toBeCloseToPixel(340); + expect(yScale.getPixelForValue(4, 0, 0)).toBeCloseToPixel(210); expect(yScale.getPixelForValue(10, 0, 0)).toBeCloseToPixel(155); expect(yScale.getPixelForValue(63, 0, 0)).toBeCloseToPixel(38.5); @@ -772,9 +773,10 @@ describe('Logarithmic Scale tests', function() { expect(yScale.getPixelForValue(70, 0, 0)).toBeCloseToPixel(484); // bottom - paddingBottom expect(yScale.getPixelForValue(0, 0, 0)).toBeCloseToPixel(32); // top + paddingTop - expect(yScale.getPixelForValue(0.063, 0, 0)).toBeCloseToPixel(41); // minNotZero 2% from range - expect(yScale.getPixelForValue(0.5, 0, 0)).toBeCloseToPixel(172); - expect(yScale.getPixelForValue(4, 0, 0)).toBeCloseToPixel(303); + expect(yScale.getPixelForValue(0.06, 0, 0)).toBeCloseToPixel(44); // first tick fontsize from 0 + expect(yScale.getPixelForValue(0.063, 0, 0)).toBeCloseToPixel(47); // minNotZero + expect(yScale.getPixelForValue(0.5, 0, 0)).toBeCloseToPixel(176); + expect(yScale.getPixelForValue(4, 0, 0)).toBeCloseToPixel(306); expect(yScale.getPixelForValue(10, 0, 0)).toBeCloseToPixel(361); expect(yScale.getPixelForValue(63, 0, 0)).toBeCloseToPixel(477); }); From 4de3227ab8621e1708559a3b6e78a603868dcc3e Mon Sep 17 00:00:00 2001 From: J Copperfield Date: Mon, 6 Nov 2017 14:10:39 +0100 Subject: [PATCH 2/5] Add: Requested code style changes for getPixelForValue and getValueForPixel Add: Tests for more extensive data containing zero values or axes configuration containing 'min: 0'-option. --- src/scales/scale.logarithmic.js | 81 ++++++++-------- test/specs/scale.logarithmic.tests.js | 132 ++++++++++++++++++-------- 2 files changed, 132 insertions(+), 81 deletions(-) diff --git a/src/scales/scale.logarithmic.js b/src/scales/scale.logarithmic.js index beffede32e5..d9fcbff6670 100644 --- a/src/scales/scale.logarithmic.js +++ b/src/scales/scale.logarithmic.js @@ -177,42 +177,45 @@ module.exports = function(Chart) { getPixelForTick: function(index) { return this.getPixelForValue(this.tickValues[index]); }, + /** + * Returns the value of the first tick + * + * @Private + * @param {Number} [value] - The minimum not zero value. + * @return {number} [firstTickValu] - The first tick value. + */ + getFirstTickValue(value) { + var exp = Math.floor(helpers.log10(value)); + var significand = Math.floor(value / Math.pow(10, exp)); + + return significand * Math.pow(10, exp); + }, getPixelForValue: function(value) { var me = this; var realValue = +me.getRightValue(value); var reverse = me.options.ticks.reverse; - var lg = helpers.log10; - var exp = Math.floor(lg(me.minNotZero)); - var significand = Math.floor(me.minNotZero / Math.pow(10, exp)); - var firstTickValue = significand * Math.pow(10, exp); + var log10 = helpers.log10; + var firstTickValue = me.getFirstTickValue(me.minNotZero); var offset = 0; - var baseValue, innerDimension, pixel, range, sign; + var baseValue, innerDimension, pixel, start, end, sign; if (reverse) { - range = { - start: me.end, - end: me.start - }; + start = me.end; + end = me.start; sign = -1; } else { - range = { - start: me.start, - end: me.end - }; + start = me.start; + end = me.end; sign = 1; } - baseValue = range.start; + baseValue = start; if (me.isHorizontal()) { innerDimension = me.width; - pixel = (reverse) - ? me.right - : me.left; + pixel = reverse ? me.right : me.left; } else { innerDimension = me.height; sign *= -1; // invert, since the upper-left corner of the canvas is at pixel (0, 0) - pixel = (reverse) - ? me.top - : me.bottom; + pixel = reverse ? me.top : me.bottom; } if (realValue !== baseValue) { if (baseValue === 0) { // include zero tick @@ -221,10 +224,10 @@ module.exports = function(Chart) { Chart.defaults.global.defaultFontSize ); innerDimension -= offset; - range.start = firstTickValue; + start = firstTickValue; } if (realValue !== 0) { - offset += innerDimension / (lg(range.end) - lg(range.start)) * (lg(realValue) - lg(range.start)); + offset += innerDimension / (log10(end) - log10(start)) * (log10(realValue) - log10(start)); } pixel += sign * offset; } @@ -233,26 +236,24 @@ module.exports = function(Chart) { getValueForPixel: function(pixel) { var me = this; var reverse = me.options.ticks.reverse; - var lg = helpers.log10; - var exp = Math.floor(lg(me.minNotZero)); - var significand = Math.floor(me.minNotZero / Math.pow(10, exp)); - var firstTickValue = significand * Math.pow(10, exp); - var range = (reverse) - ? {start: me.end, end: me.start} - : {start: me.start, end: me.end}; - var baseValue = range.start; - var innerDimension, value; + var log10 = helpers.log10; + var firstTickValue = me.getFirstTickValue(me.minNotZero); + var innerDimension, start, end, baseValue, value; + if (reverse) { + start = me.end; + end = me.start; + } else { + start = me.start; + end = me.end; + } + baseValue = start; if (me.isHorizontal()) { innerDimension = me.width; - value = (reverse) - ? me.right - pixel - : pixel - me.left; + value = reverse ? me.right - pixel : pixel - me.left; } else { innerDimension = me.height; - value = (reverse) - ? pixel - me.top - : me.bottom - pixel; + value = reverse ? pixel - me.top : me.bottom - pixel; } if (value !== baseValue) { if (baseValue === 0) { // include zero tick @@ -262,11 +263,11 @@ module.exports = function(Chart) { ); value -= offset; innerDimension -= offset; - range.start = firstTickValue; + start = firstTickValue; } - value *= lg(range.end) - lg(range.start); + value *= log10(end) - log10(start); value /= innerDimension; - value = Math.pow(10, lg(range.start) + value); + value = Math.pow(10, log10(start) + value); } return value; } diff --git a/test/specs/scale.logarithmic.tests.js b/test/specs/scale.logarithmic.tests.js index 0367ce46414..3fd92197763 100644 --- a/test/specs/scale.logarithmic.tests.js +++ b/test/specs/scale.logarithmic.tests.js @@ -735,49 +735,99 @@ describe('Logarithmic Scale tests', function() { expect(yScale.getValueForPixel(246)).toBeCloseTo(10, 1e-4); }); - it('should get the correct pixel value for a point when 0 values are present', function() { - var chart = window.acquireChart({ - type: 'bar', - data: { - datasets: [{ - yAxisID: 'yScale', - data: [0.063, 4, 0, 63, 10, 0.5] - }], - labels: [] + it('should get the correct pixel value for a point when 0 values are present or min: 0', function() { + var config = [ + { + dataset: [{x: 0, y: 0}, {x: 10, y: 10}, {x: 1.2, y: 1.2}, {x: 25, y: 25}, {x: 78, y: 78}], + firstTick: 1, // value of the first tick + lastTick: 80 }, - options: { - scales: { - yAxes: [{ - id: 'yScale', - type: 'logarithmic', - ticks: { - reverse: false - } - }] + { + dataset: [{x: 0, y: 0}, {x: 10, y: 10}, {x: 6.3, y: 6.3}, {x: 25, y: 25}, {x: 78, y: 78}], + firstTick: 6, + lastTick: 80 + }, + { + dataset: [{x: 10, y: 10}, {x: 1.2, y: 1.2}, {x: 25, y: 25}, {x: 78, y: 78}], + scale: {ticks: {min: 0}}, + firstTick: 1, + lastTick: 80 + }, + { + dataset: [{x: 10, y: 10}, {x: 6.3, y: 6.3}, {x: 25, y: 25}, {x: 78, y: 78}], + scale: {ticks: {min: 0}}, + firstTick: 6, + lastTick: 80 + }, + ]; + Chart.helpers.each(config, function(setup) { + var xScaleConfig = { + type: 'logarithmic' + }; + var yScaleConfig = { + type: 'logarithmic' + }; + Chart.helpers.extend(xScaleConfig, setup.scale); + Chart.helpers.extend(yScaleConfig, setup.scale); + var chart = window.acquireChart({ + type: 'line', + data: { + datasets: [{ + data: setup.dataset + }], + }, + options: { + scales: { + xAxes: [xScaleConfig], + yAxes: [yScaleConfig] + } } - } + }); + + var chartArea = chart.chartArea; + var expectations = [ + { + id: 'x-axis-0', // horizontal scale + axis: 'xAxes', + start: chartArea.left, + end: chartArea.right + }, + { + id: 'y-axis-0', // vertical scale + axis: 'yAxes', + start: chartArea.bottom, + end: chartArea.top + } + ]; + Chart.helpers.each(expectations, function(expectation) { + var scale = chart.scales[expectation.id]; + var firstTick = setup.firstTick; + var lastTick = setup.lastTick; + var fontSize = chart.options.defaultFontSize; + var start = expectation.start; + var end = expectation.end; + var sign = scale.isHorizontal() ? 1 : -1; + + expect(scale.getPixelForValue(0, 0, 0)).toBeCloseToPixel(start); + expect(scale.getPixelForValue(lastTick, 0, 0)).toBeCloseToPixel(end); + expect(scale.getPixelForValue(firstTick, 0, 0)).toBeCloseToPixel(start + sign * fontSize); + + expect(scale.getValueForPixel(start)).toBeCloseTo(0); + expect(scale.getValueForPixel(end)).toBeCloseTo(lastTick); + expect(scale.getValueForPixel(start + sign * fontSize)).toBeCloseTo(firstTick); + + chart.options.scales[expectation.axis][0].ticks.reverse = true; // Reverse mode + chart.update(); + + expect(scale.getPixelForValue(0, 0, 0)).toBeCloseToPixel(end); + expect(scale.getPixelForValue(lastTick, 0, 0)).toBeCloseToPixel(start); + expect(scale.getPixelForValue(firstTick, 0, 0)).toBeCloseToPixel(end - sign * fontSize); + + expect(scale.getValueForPixel(end)).toBeCloseTo(0); + expect(scale.getValueForPixel(start)).toBeCloseTo(lastTick); + expect(scale.getValueForPixel(end - sign * fontSize)).toBeCloseTo(firstTick); + }); }); - - var yScale = chart.scales.yScale; - expect(yScale.getPixelForValue(70, 0, 0)).toBeCloseToPixel(32); // top + paddingTop - expect(yScale.getPixelForValue(0, 0, 0)).toBeCloseToPixel(484); // bottom - paddingBottom - expect(yScale.getPixelForValue(0.06, 0, 0)).toBeCloseToPixel(472); // first tick fontsize from 0 - expect(yScale.getPixelForValue(0.063, 0, 0)).toBeCloseToPixel(469); // minNotZero - expect(yScale.getPixelForValue(0.5, 0, 0)).toBeCloseToPixel(340); - expect(yScale.getPixelForValue(4, 0, 0)).toBeCloseToPixel(210); - expect(yScale.getPixelForValue(10, 0, 0)).toBeCloseToPixel(155); - expect(yScale.getPixelForValue(63, 0, 0)).toBeCloseToPixel(38.5); - - chart.options.scales.yAxes[0].ticks.reverse = true; // Reverse mode - chart.update(); - - expect(yScale.getPixelForValue(70, 0, 0)).toBeCloseToPixel(484); // bottom - paddingBottom - expect(yScale.getPixelForValue(0, 0, 0)).toBeCloseToPixel(32); // top + paddingTop - expect(yScale.getPixelForValue(0.06, 0, 0)).toBeCloseToPixel(44); // first tick fontsize from 0 - expect(yScale.getPixelForValue(0.063, 0, 0)).toBeCloseToPixel(47); // minNotZero - expect(yScale.getPixelForValue(0.5, 0, 0)).toBeCloseToPixel(176); - expect(yScale.getPixelForValue(4, 0, 0)).toBeCloseToPixel(306); - expect(yScale.getPixelForValue(10, 0, 0)).toBeCloseToPixel(361); - expect(yScale.getPixelForValue(63, 0, 0)).toBeCloseToPixel(477); }); + }); From 165ad97e79810feb837a2b74329b1401f52f3e9f Mon Sep 17 00:00:00 2001 From: J Copperfield Date: Mon, 6 Nov 2017 14:55:24 +0100 Subject: [PATCH 3/5] Fix: could not minify due to invalid function declaration --- src/scales/scale.logarithmic.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scales/scale.logarithmic.js b/src/scales/scale.logarithmic.js index d9fcbff6670..96f454d9846 100644 --- a/src/scales/scale.logarithmic.js +++ b/src/scales/scale.logarithmic.js @@ -182,9 +182,9 @@ module.exports = function(Chart) { * * @Private * @param {Number} [value] - The minimum not zero value. - * @return {number} [firstTickValu] - The first tick value. + * @return {Number} [firstTickValue] - The first tick value. */ - getFirstTickValue(value) { + getFirstTickValue: function(value) { var exp = Math.floor(helpers.log10(value)); var significand = Math.floor(value / Math.pow(10, exp)); From 3519612a6f1a29a1b083e47949d53e96f3841c2e Mon Sep 17 00:00:00 2001 From: J Copperfield Date: Mon, 6 Nov 2017 18:07:07 +0100 Subject: [PATCH 4/5] Fix: renamed variables to improve readability --- src/scales/scale.logarithmic.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/scales/scale.logarithmic.js b/src/scales/scale.logarithmic.js index 96f454d9846..53e81b121ac 100644 --- a/src/scales/scale.logarithmic.js +++ b/src/scales/scale.logarithmic.js @@ -192,13 +192,13 @@ module.exports = function(Chart) { }, getPixelForValue: function(value) { var me = this; - var realValue = +me.getRightValue(value); var reverse = me.options.ticks.reverse; var log10 = helpers.log10; var firstTickValue = me.getFirstTickValue(me.minNotZero); var offset = 0; - var baseValue, innerDimension, pixel, start, end, sign; + var innerDimension, pixel, start, end, sign; + value = +me.getRightValue(value); if (reverse) { start = me.end; end = me.start; @@ -208,7 +208,6 @@ module.exports = function(Chart) { end = me.end; sign = 1; } - baseValue = start; if (me.isHorizontal()) { innerDimension = me.width; pixel = reverse ? me.right : me.left; @@ -217,8 +216,8 @@ module.exports = function(Chart) { sign *= -1; // invert, since the upper-left corner of the canvas is at pixel (0, 0) pixel = reverse ? me.top : me.bottom; } - if (realValue !== baseValue) { - if (baseValue === 0) { // include zero tick + if (value !== start) { + if (start === 0) { // include zero tick offset = helpers.getValueOrDefault( me.options.ticks.fontSize, Chart.defaults.global.defaultFontSize @@ -226,8 +225,8 @@ module.exports = function(Chart) { innerDimension -= offset; start = firstTickValue; } - if (realValue !== 0) { - offset += innerDimension / (log10(end) - log10(start)) * (log10(realValue) - log10(start)); + if (value !== 0) { + offset += innerDimension / (log10(end) - log10(start)) * (log10(value) - log10(start)); } pixel += sign * offset; } @@ -238,7 +237,7 @@ module.exports = function(Chart) { var reverse = me.options.ticks.reverse; var log10 = helpers.log10; var firstTickValue = me.getFirstTickValue(me.minNotZero); - var innerDimension, start, end, baseValue, value; + var innerDimension, start, end, value; if (reverse) { start = me.end; @@ -247,7 +246,6 @@ module.exports = function(Chart) { start = me.start; end = me.end; } - baseValue = start; if (me.isHorizontal()) { innerDimension = me.width; value = reverse ? me.right - pixel : pixel - me.left; @@ -255,8 +253,8 @@ module.exports = function(Chart) { innerDimension = me.height; value = reverse ? pixel - me.top : me.bottom - pixel; } - if (value !== baseValue) { - if (baseValue === 0) { // include zero tick + if (value !== start) { + if (start === 0) { // include zero tick var offset = helpers.getValueOrDefault( me.options.ticks.fontSize, Chart.defaults.global.defaultFontSize From c5e24a6120edbef62309e90fbc38327f0caecef3 Mon Sep 17 00:00:00 2001 From: J Copperfield Date: Fri, 10 Nov 2017 09:03:24 +0100 Subject: [PATCH 5/5] Fix: prefix private function with _ and correct jsdocs --- src/scales/scale.logarithmic.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/scales/scale.logarithmic.js b/src/scales/scale.logarithmic.js index 53e81b121ac..09296c19568 100644 --- a/src/scales/scale.logarithmic.js +++ b/src/scales/scale.logarithmic.js @@ -178,13 +178,12 @@ module.exports = function(Chart) { return this.getPixelForValue(this.tickValues[index]); }, /** - * Returns the value of the first tick - * - * @Private - * @param {Number} [value] - The minimum not zero value. - * @return {Number} [firstTickValue] - The first tick value. + * Returns the value of the first tick. + * @param {Number} value - The minimum not zero value. + * @return {Number} The first tick value. + * @private */ - getFirstTickValue: function(value) { + _getFirstTickValue: function(value) { var exp = Math.floor(helpers.log10(value)); var significand = Math.floor(value / Math.pow(10, exp)); @@ -194,7 +193,7 @@ module.exports = function(Chart) { var me = this; var reverse = me.options.ticks.reverse; var log10 = helpers.log10; - var firstTickValue = me.getFirstTickValue(me.minNotZero); + var firstTickValue = me._getFirstTickValue(me.minNotZero); var offset = 0; var innerDimension, pixel, start, end, sign; @@ -236,7 +235,7 @@ module.exports = function(Chart) { var me = this; var reverse = me.options.ticks.reverse; var log10 = helpers.log10; - var firstTickValue = me.getFirstTickValue(me.minNotZero); + var firstTickValue = me._getFirstTickValue(me.minNotZero); var innerDimension, start, end, value; if (reverse) {