From 584f0f26f08edddc4cbc7b12c00df8b356e99246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Tue, 5 Mar 2019 10:44:29 +0100 Subject: [PATCH] Update chart colors to match spec (https://github.com/woocommerce/woocommerce-admin/pull/1731) * Update chart color scale to match woocommerce/woocommerce-admin#375 * Avoid useless calls to 'getColor' --- .../packages/components/src/chart/constants.js | 6 +++--- .../packages/components/src/chart/d3chart/legend.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/woocommerce-admin/packages/components/src/chart/constants.js b/plugins/woocommerce-admin/packages/components/src/chart/constants.js index afdb8c112aa..081962e7aae 100644 --- a/plugins/woocommerce-admin/packages/components/src/chart/constants.js +++ b/plugins/woocommerce-admin/packages/components/src/chart/constants.js @@ -7,7 +7,7 @@ export const colorScales = [ [], [ 0.5 ], [ 0.333, 0.667 ], - [ 0.25, 0.50, 0.75 ], - [ 0.20, 0.40, 0.60, 0.80 ], - [ 0.16, 0.32, 0.48, 0.64, 0.80 ], + [ 0.2, 0.50, 0.8 ], + [ 0.12, 0.375, 0.625, 0.88 ], + [ 0, 0.25, 0.5, 0.75, 1 ], ]; diff --git a/plugins/woocommerce-admin/packages/components/src/chart/d3chart/legend.js b/plugins/woocommerce-admin/packages/components/src/chart/d3chart/legend.js index 523243ec9ee..1f99bee3bb5 100644 --- a/plugins/woocommerce-admin/packages/components/src/chart/d3chart/legend.js +++ b/plugins/woocommerce-admin/packages/components/src/chart/d3chart/legend.js @@ -114,7 +114,7 @@ class D3Legend extends Component { 'woocommerce-legend__item-checkmark-checked': row.visible, } ) } id={ row.key } - style={ { color: getColor( keys, colorScheme )( row.key ) } } + style={ row.visible ? { color: getColor( keys, colorScheme )( row.key ) } : null } /> { row.key }