question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stacked Area Chart onPress get value and position for tooltip

See original GitHub issue

What is the problem?

For Stacked Area Chart, onPress is explicit in svgs array, not in the data. We’re unable to get the values & position of the pressed item.

When does it happen?

Clicking a value in the chart.

What platform?

  • iOS
  • Android 27.0.0

React Native version: 0.55.2

Code to reproduce

     const colors = [ '#8800cc' ];
     const keys   = [ 'count' ];
     const svgs = [ { onPress: () => console.log('apples') }]
    <StackedAreaChart
                            style={ { height: 200, paddingVertical: 16 } }
                            data={ data }
                            keys={ keys }
                            colors={ colors }
                            curve={ shape.curveNatural }
                            svgs={ svgs }
                        />

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:19 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
msevestrecommented, Jul 31, 2018

@kashifsulaiman Thanks!! Cheers

1reaction
kashifsulaimancommented, Jul 25, 2018

@JesperLekland It worked using Decorators! Thanks alot!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Sort a Tooltip in a Stacked Bar Chart in Chart JS
How to Sort a Tooltip in a Stacked Bar Chart in Chart JSCustomize your tooltip to sort a tooltip data based on stacked...
Read more >
Victory Stacked Area giving undefined on tooltip
eventHandlers should be given as an object whose keys are standard event names (e.g., onClick) and whose values are event callbacks.
Read more >
Adding Tooltip to React-Native Charts - Level Up Coding
We obviously want this tooltip to be positioned dynamically and show value according to the data points rendered on the chart.
Read more >
Tooltip - Chart.js
The xAlign and yAlign options define the position of the tooltip caret. If these parameters are unset, the optimal caret position is determined....
Read more >
Tooltips - Victory
When tooltips are added to a chart in this way, defaultEvents on VictoryTooltip are automatically added to the component using them, in this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found