Reputation: 443
I am using line chart for showing data. It working absolutely fine but if my data has negative value in that condition my chart is cutting from bottom.
You can see my error in above image which marked with red color.
I used react-native-pure-chart - below link :-
https://www.npmjs.com/package/react-native-pure-chart
<PureChart type={'line'}
numberOfYAxisGuideLine={0}
data={this.state.sampleData}
width={'100%'}
height={72}
backgroundColor={'#2c3554'}
color={'#2c3554'}
/>
My data is [10,-2,6]
Please help me. Thank you in advance
Upvotes: 0
Views: 660
Reputation: 443
I got the solution.
Use react-native-svg-chart (Linechart).
It will solve the issue.
Below is my code :-
import { LineChart } from 'react-native-svg-charts'
<LineChart
style={{ flex: 1, marginLeft: 4 }}
data={this.state.sampleData}
svg={{ stroke: 'rgb(211, 234, 250,0.7)' }}
contentInset={contentInset}
/>
Upvotes: 1