Skip to content

Commit

Permalink
Replace check for percent with a check for same formatters in common
Browse files Browse the repository at this point in the history
  • Loading branch information
DianaDerevyankina committed Nov 16, 2020
1 parent 1a0e740 commit 8f820bc
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ export class TimeseriesVisualization extends Component {
const yAxis = [];
let mainDomainAdded = false;

const allSeriesHavePercentFormatter = seriesModel.every(
(seriesGroup) => seriesGroup.formatter === 'percent'
const allSeriesHaveSameFormatters = seriesModel.every(
(seriesGroup) => seriesGroup.formatter === seriesModel[0].formatter
);

this.showToastNotification = null;
Expand Down Expand Up @@ -201,9 +201,7 @@ export class TimeseriesVisualization extends Component {
seriesDataRow.useDefaultGroupDomain = !isCustomDomain;
});

const tickFormatter = allSeriesHavePercentFormatter
? this.yAxisStackedByPercentFormatter
: (val) => val;
const tickFormatter = allSeriesHaveSameFormatters ? seriesGroupTickFormatter : (val) => val;

if (isCustomDomain) {
TimeseriesVisualization.addYAxis(yAxis, {
Expand Down

0 comments on commit 8f820bc

Please sign in to comment.