react-native-chart icon indicating copy to clipboard operation
react-native-chart copied to clipboard

Fixed max data set

Open KalebPortillo opened this issue 8 years ago • 4 comments

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

KalebPortillo avatar Jul 28 '16 13:07 KalebPortillo

1+

skleest avatar Oct 10 '16 00:10 skleest

+1

hugohow avatar Mar 07 '17 11:03 hugohow

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}

hugohow avatar Mar 07 '17 11:03 hugohow

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.

tomauty avatar Jul 07 '17 20:07 tomauty