From e56894c816bf372ee69f2f6ebdcb1b6cc9e7b33a Mon Sep 17 00:00:00 2001 From: Diana Derevyankina <54894989+DziyanaDzeraviankina@users.noreply.github.com> Date: Wed, 18 Nov 2020 15:58:53 +0300 Subject: [PATCH] [TSVB] Y-axis has number formatting not considering all series formatters 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 --- .../application/components/vis_types/timeseries/vis.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.js b/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.js index 2434285bd94c6..478b8f517fbff 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.js +++ b/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.js @@ -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) => { @@ -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,