Label(Tooltip) Not working on Linear Chart
See original GitHub issueI 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
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:
- Created 2 years ago
- Comments:8
Top 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 >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
I found the same issue. In my case, resolve by remove @nivo/api package
package.json
I remove “@nivo/api”: “^0.74.1”, and then everything works fine 👍
bump