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.

Label(Tooltip) Not working on Linear Chart

See original GitHub issue

I made a linear chart with the following props

<StyledContainer style={props ? { ...props } : {}}>
     <ResponsiveLine
       colors={{ datum: 'color' }}
       data={data}
       margin={{ top: 12, right: 48, bottom: 40, left: 60 }}
       xScale={{ type: 'point' }}
       yScale={{
         type: 'linear',
         min: 0,
       }}
       axisLeft={{
         legendPosition: 'start',
         renderTick: props => {
           const transformProperty = `translate(${props.x},${props.y})`;
           if (props.tickIndex % 2 === 0) {
             return (
               <g transform={transformProperty}>
                 <line x1='0' x2='-5' y1='0' y2='0' style={{ stroke: 'rgb(119, 119, 119)', strokeWidth: 1 }}></line>
                 <text dominantBaseline='central' textAnchor='end' transform='translate(-10,0)' fontSize={11}>
                   {props.value}
                 </text>
               </g>
             );
           }
           return <></>;
         },
       }}
       axisBottom={{
         renderTick: () => <></>,
       }}
       curve='monotoneX'
       pointBorderColor={theme.colors.primary}
       pointBorderWidth={2}
       useMesh
       animate
       enableGridX={false}
       isInteractive
     />
   </StyledContainer>

I even tried just copy paste the code from the demo here : https://nivo.rocks/line/

Expected behavior A tooltip should appear when I hover on the graph

Current behavior No tooltip is shown

Screenshots Screen Shot 2022-02-14 at 12 58 30 AM

Desktop:

  • OS: MacOs Monterey 12.1
  • Browser : Chrome -Version 98.0.4758.80 (Official Build) (arm64)

Additional context @nivo/core": “^0.79.0” @nivo/line": “^0.79.0”

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
kitraveecommented, Feb 27, 2022

I found the same issue. In my case, resolve by remove @nivo/api package

package.json

"@nivo/api": "^0.74.1", // !EXCIDENT
"@nivo/core": "0.79.0",
"@nivo/line": "0.79.0",

image

I remove “@nivo/api”: “^0.74.1”, and then everything works fine 👍

image

0reactions
naren-sureifycommented, Nov 29, 2022

bump

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chart.js line chart tooltip shows wrong label when line doesn't ...
The problem is that when line data doesn't start from first label (like in my case), the tooltip shows incorrect label on hover....
Read more >
Tooltip - Chart.js
Returns text to render before an individual label. This will be called for each item in the tooltip. label, TooltipItem, string | string[]...
Read more >
Tooltips | Charts - Google Developers
The column chart below shows a chart of the highest recent viewership of several major sporting events, with the tooltips for each showing...
Read more >
How to Show the Labels in the Customize Tooltip in Chart JS
The method we will be using is unqiue and uncommon so this is not official. ... With chart js you can make line...
Read more >
[Solved]-chart.js tooltip position, tooltip not displayed-Chart.js
Related Query · show label in tooltip but not in x axis for chartjs line chart · ng2-charts customize data and whole html...
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