react-native-chart
react-native-chart copied to clipboard
Fixed max data set
Hello, I wonder if it's possible to fix a Max data set.
For example, I have a data set like: let data = [ ["Monday", 75], ["Tuesday", 60], ["Wednesday", 20] ]
As today, in the bar chart for example, the bar with data of 75 would stay filling all the height of the chart, and what I want is to have a fixed data of 100 in the chart, so the bar with data of 75 would be just filling 3/4 of the total height of the chart.
Was I clear?
Thanks for all the help
1+
+1
I change in node_modules/react-native-chart/src/Chart.js in render :
in YAxis component
maxVerticalBound={this.state.bounds.max}
to this : maxVerticalBound={this.state.bounds.max * 1.2}
and this in ChartType component
height={this.state.containerHeight - this.props.xAxisHeight}
to this : height={(this.state.containerHeight - this.props.xAxisHeight)*1.2}
As a generic FYI — I am no longer able to maintain this library. I recommend checking out victory-native as it's much more maintained.