From bf6a647c79d3d5a8739956a8bc5bbeeb414f02e9 Mon Sep 17 00:00:00 2001 From: Robert Elliott Date: Mon, 10 Sep 2018 13:23:50 +0200 Subject: [PATCH] standard vs comparison legend layout --- .../client/components/chart/index.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/plugins/woocommerce-admin/client/components/chart/index.js b/plugins/woocommerce-admin/client/components/chart/index.js index 3df7e67cf63..137cc88d66e 100644 --- a/plugins/woocommerce-admin/client/components/chart/index.js +++ b/plugins/woocommerce-admin/client/components/chart/index.js @@ -129,8 +129,10 @@ class Chart extends Component { render() { const { orderedKeys, visibleData, width } = this.state; - const legendDirection = orderedKeys.length <= 2 && width > WIDE_BREAKPOINT ? 'row' : 'column'; - const chartDirection = orderedKeys.length > 2 && width > WIDE_BREAKPOINT ? 'row' : 'column'; + const legendDirection = + this.props.layout === 'standard' && width > WIDE_BREAKPOINT ? 'row' : 'column'; + const chartDirection = + this.props.layout === 'comparison' && width > WIDE_BREAKPOINT ? 'row' : 'column'; const legend = (