From f39a07b41e0a89ea7124f191a84f08415dd178cb Mon Sep 17 00:00:00 2001 From: Tayfun Kayahan Date: Tue, 13 Nov 2018 14:52:18 +0100 Subject: [PATCH] The decimalPlaces property was not fixed, rather the hardcoded 2 was used for decimalPlaces --- src/abstract-chart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/abstract-chart.js b/src/abstract-chart.js index f1d699aa..339bc001 100644 --- a/src/abstract-chart.js +++ b/src/abstract-chart.js @@ -41,7 +41,7 @@ class AbstractChart extends Component { y={(height * 3 / 4) - ((height - paddingTop) / count * i) + 12} fontSize={12} fill={this.props.chartConfig.color(0.5)} - >{count === 1 ? data[0].toFixed(2) : ((this.calcScaler(data) / (count - 1)) * i + Math.min(...data)).toFixed(2)} + >{count === 1 ? data[0].toFixed(decimalPlaces) : ((this.calcScaler(data) / (count - 1)) * i + Math.min(...data)).toFixed(decimalPlaces)} ) })