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.

Tooltip’s label does not change. The default label is the dataKey of YAxis. I want to change it to a simple string

<BarChart width={600} height={350} data={data} layout="vertical" > ... <YAxis dataKey="info" ... /> <Tooltip label="Info" /> ... </BarChart>

When I change label I expect it to change also in the box when I am over a bar.

recharts v0.22.4

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:18
  • Comments:19

github_iconTop GitHub Comments

15reactions
BrenoVelascocommented, Oct 28, 2020

Three years have passed and not a single solution. Please, this is so basic it’s embarassing.

8reactions
bartoostencommented, Oct 5, 2021

I was running into the same issue, I found out if I apply a name prop to Line component it get inherited to the Tooltip component. This example has a name property ‘Price’, will get displayed in the Tooltip label

<Line
    type="monotone"
    dataKey="1"
    name="Price"
    stroke="rgb(173, 155, 246)"
    strokeWidth={2}
    dot={false}
    activeDot={{ r: 8 }}
/>

Maybe that’s an option for some people here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Display tooltip on Label's hover? - Stack Overflow
Sanchit, i usually get the label value using jquery ajax call. So, can i set title value dynamically? – user755806. Feb 26, 2014...
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 >
CSS Tooltip - W3Schools
A tooltip is often used to specify extra information about something when ... Create a tooltip that appears when the user moves the...
Read more >
Tooltips - Bootstrap
Documentation and examples for adding custom Bootstrap tooltips with CSS and JavaScript using CSS3 for animations and data-attributes for local title storage.
Read more >
Tooltips - Material Design
When activated, tooltips display a text label identifying an element, such as a description of its function. Principles. Transient. Tooltips appear on hover, ......
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