diff --git a/src/plugins/chart_expressions/expression_xy/public/components/x_domain.tsx b/src/plugins/chart_expressions/expression_xy/public/components/x_domain.tsx index 42d66570e8fe6..c23c90ed91ef3 100644 --- a/src/plugins/chart_expressions/expression_xy/public/components/x_domain.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/components/x_domain.tsx @@ -60,7 +60,7 @@ export const getXDomain = ( : undefined; if (isHistogram && isFullyQualified(baseDomain)) { - if (xExtent) { + if (xExtent && !isTimeViz) { return { extendedDomain: { min: xExtent.lowerBound ?? NaN, diff --git a/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.test.tsx b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.test.tsx index a19132ba8193e..b488de0b703ce 100644 --- a/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.test.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.test.tsx @@ -506,6 +506,12 @@ describe('XYChart component', () => { {...defaultProps} args={{ ...args, + layers: [ + { + ...(args.layers[0] as DataLayerConfig), + isHistogram: true, + }, + ], xExtent: { type: 'axisExtentConfig', mode: 'custom', @@ -518,6 +524,7 @@ describe('XYChart component', () => { expect(component.find(Settings).prop('xDomain')).toEqual({ min: 123, max: 456, + minInterval: 50, }); } });