diff --git a/src/core_plugins/timelion/public/panels/timechart/schema.js b/src/core_plugins/timelion/public/panels/timechart/schema.js index 7ebd7239919b0..34bf6f665bf6e 100644 --- a/src/core_plugins/timelion/public/panels/timechart/schema.js +++ b/src/core_plugins/timelion/public/panels/timechart/schema.js @@ -230,15 +230,17 @@ module.exports = function timechartFn(Private, config, $rootScope, timefilter, $ return series; }); - options.yaxes.forEach(yaxis => { - if (yaxis && yaxis.units) { - yaxis.tickFormatter = tickFormatters[yaxis.units.type]; - const byteModes = ['bytes', 'bytes/s']; - if (byteModes.includes(yaxis.units.type)) { - yaxis.tickGenerator = generateTicks(yaxis); + if (options.yaxes) { + options.yaxes.forEach(yaxis => { + if (yaxis && yaxis.units) { + yaxis.tickFormatter = tickFormatters[yaxis.units.type]; + const byteModes = ['bytes', 'bytes/s']; + if (byteModes.includes(yaxis.units.type)) { + yaxis.tickGenerator = generateTicks(yaxis); + } } - } - }); + }); + } try { $scope.plot = $.plot(canvasElem, _.compact(series), options);