AreaChart + tooltip
See original GitHub issueWhat is the problem?
I can’t make onPress working on AreaChart, I would like to show a popup with additional information when pressed (Ideally i would like to be onMove but I don’t see the possibility in the library)
What platform?
Running natively on the ios simulator, no expo
- [latest on xr] iOS
- Android
React Native version: 0.57.6
Code to reproduce
Please notice all onPress are commented out but neither was working
render () {
const points = [1,4,21,3,7,100, 50, 20, 1,3,5,6,76,33,46,88]
const Gradient = () => (
<Defs key={'gradient'}>
<LinearGradient id={'gradient'} x1={'0'} y={'100%'} x2={'0'} y2={'50%'}>
<Stop offset={'0%'} stopColor={'rgb(64, 135, 249)'} stopOpacity={0.1}/>
<Stop offset={'100%'} stopColor={'rgb(64, 135, 249)'} stopOpacity={0.05}/>
</LinearGradient>
</Defs>
)
const indexToClipFrom = 10
const Line = ({ line }) => (
<Path
key={'line'}
d={line}
stroke={'rgb(28, 114, 147)'}
fill={'none'}
// onPress={(a, b, c) => console.tron.log(a, b, c)}
/>
)
return (
<AreaChart
style={{ height: 200, width: Dimensions.get('window').width }}
data={points}
contentInset={{ top: 20, bottom: 20 }}
// onPress={(a,b,c) => console.tron.log(a,b,c)}
svg={{
fill: 'url(#gradient)',
// onPress: (a, b, c) => console.tron.log(a, b, c)
}}
>
<Gradient />
<Line />
{/* <Tooltip /> */}
</AreaChart>
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Simple Area Chart with Tooltip / Elisha Terada - Observable
I wanted to create a simple area chart with tooltip as data viz exercise and found myself Googling many resources to make this...
Read more >Area chart with moving tooltip - GitHub Gist
Area chart with moving tooltip. GitHub Gist: instantly share code, notes, and snippets.
Read more >plotOptions.area.tooltip | highcharts API Reference
A configuration object for the tooltip rendering of each single series. Properties are inherited from tooltip, but only the following properties can be...
Read more >Tutorial: Stacked Area Chart
Stacked Area Chart · Stacked Area Chart with Tooltip · Stacked Area Chart with fixed Aspect Ratio · Stacked Area Chart with custom...
Read more >Tooltips | Charts - Google Developers
Specifying the tooltip type ... Google Charts automatically creates tooltips for all core charts. They'll be rendered as SVG by default, except under...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@AravindTReddy
I was able to achieve onPress and not onMove
` import React from ‘react’ import { View, Alert } from ‘react-native’ import { BarChart, Grid } from ‘react-native-svg-charts’ import { Text, Line, Circle, G, Rect, } from ‘react-native-svg’
`
@vrinch Can you please share your way around. Thanks