Heya,
Just looked into the code of this awesome charting library and found a bug which could be fixed very easily:
In src/abstract-chart.js we have the renderHorizontalLabels function which gets the decimalPlaces property, but is not used :( It is hardcoded in the code to 2;
<Text
key={Math.random()}
x={paddingRight - yLabelsOffset}
textAnchor="end"
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)}
</Text>
To allow us to change the decimalPlaces we need this piece of code: (change 2 to the variable)
<Text
key={Math.random()}
x={paddingRight - yLabelsOffset}
textAnchor="end"
y={(height * 3 / 4) - ((height - paddingTop) / count * i) + 12}
fontSize={12}
fill={this.props.chartConfig.color(0.5)}
>{count === 1 ? data[0].toFixed(decimalPlaces) : ((this.calcScaler(data) / (count - 1)) * i + Math.min(...data)).toFixed(decimalPlaces)}
</Text>
@Hermanya I have a PR for this issue: #60
Heya,
Just looked into the code of this awesome charting library and found a bug which could be fixed very easily:
In
src/abstract-chart.jswe have therenderHorizontalLabelsfunction which gets thedecimalPlacesproperty, but is not used :( It is hardcoded in the code to 2;To allow us to change the
decimalPlaceswe need this piece of code: (change 2 to the variable)@Hermanya I have a PR for this issue: #60