From 53b4716781f025920063b48ba7c6ac28f5d6c081 Mon Sep 17 00:00:00 2001 From: Glib Briia Date: Mon, 4 Jan 2021 18:42:16 +0000 Subject: [PATCH] Use same colors in legend if withCustomBarColorFromData is set --- src/ProgressChart.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ProgressChart.tsx b/src/ProgressChart.tsx index aa15ab4d..a4e8be57 100644 --- a/src/ProgressChart.tsx +++ b/src/ProgressChart.tsx @@ -104,7 +104,11 @@ class ProgressChart extends AbstractChart< key={Math.random()} width="16px" height="16px" - fill={this.props.chartConfig.color(0.2 * (i + 1), i)} + fill={ + this.props.withCustomBarColorFromData + ? withColor(i) + : this.props.chartConfig.color(0.2 * (i + 1), i) + } rx={8} ry={8} x={this.props.width / 2.5 - 24}