Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
maryia-lapata committed Jan 15, 2020
1 parent 426f376 commit 66f706c
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,22 @@ function buildSeriesData(chart: Series[], options: jquery.flot.plotOptions) {
});
}

if (options.yaxes) {
options.yaxes.forEach((yaxis: Axis) => {
if (yaxis && yaxis.units) {
const formatters = tickFormatters();
yaxis.tickFormatter = formatters[yaxis.units.type as keyof typeof formatters];
const byteModes = ['bytes', 'bytes/s'];
if (byteModes.includes(yaxis.units.type)) {
yaxis.tickGenerator = generateTicksProvider();
}
}
});
}

return newSeries;
});

if (options.yaxes) {
options.yaxes.forEach((yaxis: Axis) => {
if (yaxis && yaxis.units) {
const formatters = tickFormatters();
yaxis.tickFormatter = formatters[yaxis.units.type as keyof typeof formatters];
const byteModes = ['bytes', 'bytes/s'];
if (byteModes.includes(yaxis.units.type)) {
yaxis.tickGenerator = generateTicksProvider();
}
}
});
}

return compact(seriesData);
}

Expand Down

0 comments on commit 66f706c

Please sign in to comment.