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 (elastic#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 committed Nov 30, 2020
1 parent c943e8b commit e56894c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,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 @@ -219,7 +223,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 e56894c

Please sign in to comment.