Open atlas-itrc opened 4 days ago
renderTooltip is not working as expected even though i have added the required prop:
` <BarChart data={barData} barWidth={20} yAxisTextStyle={{ color: 'gray' }} noOfSections={4} maxValue={400} width={500} // Adjust width for landscape view labelWidth={80} isAnimated renderTooltip={(item, index) => { console.log(item); return ( <View style={ { // marginBottom: 20, // // marginLeft: -6, // backgroundColor: '#ffcefe', // // paddingHorizontal: 6, // paddingVertical: 4, // // borderRadius: 4, } }>
</View> ); }} /> the console is showing the log for the item, but i am expecting the item value to show on the top of the bar.
`
I have tried using the same exact example from the documentation. but it is still not working.
https://snack.expo.dev/3ouoGiXPdTpeRR7GAjx_R
1.4.47
0.74.5
Android
Expo Dev Client
The problem is caused by default tooltip offset configured here
You can compensate it by setting top: 60 or bottom: -60 to render your tooltip right above the bar. Here is a link to snack with a fix: click!
top: 60
bottom: -60
Description
renderTooltip is not working as expected even though i have added the required prop:
` <BarChart data={barData} barWidth={20} yAxisTextStyle={{ color: 'gray' }} noOfSections={4} maxValue={400} width={500} // Adjust width for landscape view labelWidth={80} isAnimated renderTooltip={(item, index) => { console.log(item); return ( <View style={ { // marginBottom: 20, // // marginLeft: -6, // backgroundColor: '#ffcefe', // // paddingHorizontal: 6, // paddingVertical: 4, // // borderRadius: 4, } }>
`
Steps to reproduce
I have tried using the same exact example from the documentation. but it is still not working.
Snack or a link to a repository
https://snack.expo.dev/3ouoGiXPdTpeRR7GAjx_R
version of react-native-gifted-charts
1.4.47
React Native version
0.74.5
Platforms
Android
Workflow
Expo Dev Client