From 3abbaff8775fd7ba5836632be2ffaeae20f06179 Mon Sep 17 00:00:00 2001 From: Jukka Kurkela Date: Thu, 10 Jan 2019 19:49:19 +0200 Subject: [PATCH] Vertify ticks is an array and update docs --- docs/axes/README.md | 2 +- src/core/core.scale.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/axes/README.md b/docs/axes/README.md index 3eb5592147f..ba408409e0c 100644 --- a/docs/axes/README.md +++ b/docs/axes/README.md @@ -31,7 +31,7 @@ There are a number of config callbacks that can be used to change parameters in | `beforeDataLimits` | `axis` | Callback that runs before data limits are determined. | `afterDataLimits` | `axis` | Callback that runs after data limits are determined. | `beforeBuildTicks` | `axis` | Callback that runs before ticks are created. -| `afterBuildTicks` | `axis`, `ticks` | Callback that runs after ticks are created. Useful for filtering ticks (*Should return the filtered ticks*). +| `afterBuildTicks` | `axis`, `ticks` | Callback that runs after ticks are created. Useful for filtering ticks. Should return the filtered ticks. | `beforeTickToLabelConversion` | `axis` | Callback that runs before ticks are converted into strings. | `afterTickToLabelConversion` | `axis` | Callback that runs after ticks are converted into strings. | `beforeCalculateTickRotation` | `axis` | Callback that runs before tick rotation is determined. diff --git a/src/core/core.scale.js b/src/core/core.scale.js index 4718b2226d6..1f6cdf01872 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -291,7 +291,7 @@ module.exports = Element.extend({ afterBuildTicks: function(ticks) { var me = this; // ticks is empty for old axis implementations here - if (ticks.length) { + if (helpers.isArray(ticks) && ticks.length) { return helpers.callback(me.options.afterBuildTicks, [me, ticks]); } // Support old implementatios (that modified `this.ticks` directly in buildTicks)