diff --git a/src/components/xy_chart/series/__snapshots__/area_series.test.js.snap b/src/components/xy_chart/series/__snapshots__/area_series.test.js.snap index 35737f402a1..3d0b5e4b116 100644 --- a/src/components/xy_chart/series/__snapshots__/area_series.test.js.snap +++ b/src/components/xy_chart/series/__snapshots__/area_series.test.js.snap @@ -24,6 +24,14 @@ exports[`EuiAreaSeries all props are rendered 1`] = ` data-test-subj="test subject string" enableSelectionBrush={false} height={200} + margins={ + Object { + "bottom": 40, + "left": 40, + "right": 10, + "top": 10, + } + } orientation="vertical" selectionBrushOrientation="horizontal" showCrosshair={true} diff --git a/src/components/xy_chart/series/__snapshots__/line_series.test.js.snap b/src/components/xy_chart/series/__snapshots__/line_series.test.js.snap index 724bbed719e..b269c1f32c2 100644 --- a/src/components/xy_chart/series/__snapshots__/line_series.test.js.snap +++ b/src/components/xy_chart/series/__snapshots__/line_series.test.js.snap @@ -18,6 +18,14 @@ exports[`EuiLineSeries all props are rendered 1`] = ` animation={null} enableSelectionBrush={false} height={200} + margins={ + Object { + "bottom": 40, + "left": 40, + "right": 10, + "top": 10, + } + } orientation="vertical" selectionBrushOrientation="horizontal" showCrosshair={true} @@ -4120,6 +4128,14 @@ exports[`EuiLineSeries is rendered 1`] = ` data-test-subj="test subject string" enableSelectionBrush={false} height={200} + margins={ + Object { + "bottom": 40, + "left": 40, + "right": 10, + "top": 10, + } + } orientation="vertical" selectionBrushOrientation="horizontal" showCrosshair={true} diff --git a/src/components/xy_chart/xy_chart.js b/src/components/xy_chart/xy_chart.js index 35b8071ef28..d901e8aee89 100644 --- a/src/components/xy_chart/xy_chart.js +++ b/src/components/xy_chart/xy_chart.js @@ -90,6 +90,7 @@ class XYChart extends PureComponent { children, width, height, + margins, xType, yType, stackBy, @@ -134,7 +135,7 @@ class XYChart extends PureComponent { width={width} animation={animateData} height={height} - margin={DEFAULT_MARGINS} + margin={margins} xType={xType} yType={yType} xDomain={xDomain} @@ -214,6 +215,7 @@ XYChart.defaultProps = { showDefaultAxis: true, enableSelectionBrush: false, selectionBrushOrientation: HORIZONTAL, + margins: DEFAULT_MARGINS, }; export const EuiXYChart = makeVisFlexible(XYChart);