Skip to content

Commit

Permalink
[TSVB] Y-axis has number formatting not considering all series format…
Browse files Browse the repository at this point in the history
…ters in the group (#83438)

* [TSVB] Y-axis has number formatting not considering all series formatters in the group

* Replace check for percent with a check for same formatters in common

* Remove unnecessary series check
  • Loading branch information
DianaDerevyankina authored Nov 18, 2020
1 parent 00c0535 commit 957882a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ export class TimeseriesVisualization extends Component {
const yAxis = [];
let mainDomainAdded = false;

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

this.showToastNotification = null;

seriesModel.forEach((seriesGroup) => {
Expand Down Expand Up @@ -211,7 +215,7 @@ export class TimeseriesVisualization extends Component {
});
} else if (!mainDomainAdded) {
TimeseriesVisualization.addYAxis(yAxis, {
tickFormatter: series.length === 1 ? undefined : (val) => val,
tickFormatter: allSeriesHaveSameFormatters ? seriesGroupTickFormatter : (val) => val,
id: yAxisIdGenerator('main'),
groupId: mainAxisGroupId,
position: model.axis_position,
Expand Down

0 comments on commit 957882a

Please sign in to comment.