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.

ResponsiveLine is not interactive on mobile

See original GitHub issue

The ResponsiveLine chart component is not interactive on iOS devices. Working fine on Samsung S8, S9 and OpenPlus 5, but not on iPhone 6 and 7.

The flag for interactivity (isInteractive) is set to true by default and the chart doesn’t have any customizations.

The tooltip shows and the chart is interactive on Samsung S8.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
martin-kieliszekcommented, Apr 23, 2019

I’ve managed to modify the library locally to enable tooltips to work for iPhones

Tested on iPhone 8S - confirmed didn’t work before, worked after Tested on iPhone 6S - confirmed didn’t work before, worked after Tested on iPad Mini - confirmed didn’t work before, worked after

Is it possible for you to review @plouc ? (edit: sorry for errant tag @iliyanyotov) Appears to be very quick fix that I’m sure a large contingent of users would like to see - especially those that may not have known their line graph tooltips aren’t working on some iPhones.

I simply added onClick: showTooltip, to the LineSlicesItem element :

nivo-line-umd.js line 227 nivo-line-esm.js line 226 nivo-line-cjs.js line 233

Example:


React.createElement("rect", {
    x: -20,
    width: 40,
    height: height,
    fill: "#F00",
    fillOpacity: 0,
    onMouseEnter: showTooltip,
    onMouseMove: showTooltip,
    onMouseLeave: hideTooltip,
    onClick: showTooltip,    <---------------------- Added 
  }));

Please feel free to improve further if you can think of other use cases or if issues are discovered.

I look forward to your response and potential push

Edit: Do you have any thoughts on this @plouc ? Am excited to see what your thoughts are

0reactions
alan345commented, Oct 10, 2019

@martin-kieliszek, Do you know what should be changed in the code not compiled here https://github.com/plouc/nivo/tree/master/packages/line ?

So we can fork, and create a PR for this issue? Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nivo responsive line graph only responsive on making wider ...
The problem I have is if I make the browser narrower the graph does not resize to fill 100% of the browser width...
Read more >
Beautiful and Responsive Line Charts Using Nivo, React and ...
In this tutorial, we will build a very simple React application that displays a responsive, colorful line chart of temperature data.
Read more >
Line chart | nivo
Line chart with stacking ability. Given an array of data series having an id and a nested array of points (with x, y...
Read more >
How to make your HTML responsive by adding a single line of ...
In this article, I'll teach you how to use CSS Grid to create a super cool image grid which varies the number of...
Read more >
Improve line graphs on responsive mobile view
Make the chart scrollable on x-axis so that the dots are not squeezed together. Just resize down accordingly (I don't this can work...
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