Skip to content

Commit

Permalink
fixing broken yaxis
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Jan 13, 2017
1 parent cb8bfd5 commit c1a650c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/core_plugins/timelion/public/panels/timechart/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c1a650c

Please sign in to comment.