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.

Touch events on multiple line charts

See original GitHub issue

What is the problem?

Currently the only way to overlay multiple lines is to follow the layered charts story and overlay them. The works and displays all data, but doesn’t allow for touch events on children beyond the top most chart.

When does it happen?

Follow the decorator story, add onPress to each Circle, and add multiple line charts with the decorator child.

What platform?

  • iOS
  • Android

React Native version: 0.55.4

Code to reproduce

Object.keys(displayTypes).map((type, index) => {
      const lineData = this.getGraphData(normalizedData, type);
      const isFirst = index === 0;

      return (
        <LineChart
          key={type}
          style={isFirst ? { flex: 1 } : StyleSheet.absoluteFill}
          data={lineData}
          svg={{ stroke: lineColor, strokeWidth: 3 }}>
          {isFirst ? <Grid /> : null}
          <LinePoints
            color={lineColor}
            onPress={this.onLinePointPress}
            allData={data}
          />
        </LineChart>
      );
    });

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
alburdette619commented, Jul 31, 2018

Handling this one too…

0reactions
luki06commented, Dec 2, 2019

Hi ,Sorry am new to react native i try to use your example to create multiple line but no luck my app keep crashing,is there a solution for that,thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable the cross and other touch events in ios- ...
the zooming and touching is enabled. I do not let the user do anything in the chart, even selecting is not allowed. I...
Read more >
Multitouch done right / D3
Touch events, which can involve multiple touch, will return the coordinates of each touch in a list. For all the event types registered...
Read more >
Gestures and Touch Events | CodePath Android Cliffnotes
Gesture recognition and handling touch events is an important part of developing user ... In multiple touch events (i.e pinch open or pinch...
Read more >
Interactions | Chart.js
const chart = new Chart(ctx, { type: 'line', data: data, options: { // All of these (default) events trigger a hover and are...
Read more >
How touch events are delivered in Android | by Suragch
No one else down the line gets a chance at it. More detailed explanation. The above diagram makes things a little more simple...
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