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.

How to customize interactive tooltip?

See original GitHub issue

I would like to change the content of the interactive tooltip.

I hadn’t success by setting chart option object with following:

                ...
                useInteractiveGuideline: true,
                interactiveLayer: {
                    tooltip: {
                        gravity: 's',
                        fixedTop: 65,
                        contentGenerator: function() {return function(d) {
                            d.conseil = conseilLabel[quelConseil(d.series[0].value,d.series[1].value)]; 
                            return '<p>'+p.tooltipContent(d)+'</p>';
                        }}(),
                    },
                }

Then, I have tried by overriding chart.interactiveLayer.tooltip.contentGenerator once the chart is created. This works fine until any chart option is changed, then default content generator comes back.

What’s the best option to achieve my goal?

TIA

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Skinner927commented, Jun 9, 2015

@ilariuss You can create a graph with an object instead of a function. The object has the properties generate (which would be your regular function that you pass into addGraph) and then the callback like above.

See this for an example: https://github.com/novus/nvd3/blob/dbcdc25bd1637cbe5368a8e0f74032c1acafcb0f/examples/historicalBar.html#L30

0reactions
kashyap-cliqrcommented, Nov 23, 2016

tooltip.fixedTop(65); is not working in latest version of nvd3. any work around for this issue?

I want 2 tooltip for focus chart. one for start anchor point and another at end anchor point when someone use brush in linewithfocus chart. any idea how to achieve with nvd3? can I create 2 tooltip with nvd3 for focus chart and set their position?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tooltips: How to Create and Use Them Like a Pro - UserGuiding
During the tooltip design process, your product team should: Mind the tooltip content,. Use interactive elements when necessary,.
Read more >
Create an interactive custom tooltip for chartjs - Stack Overflow
I'm using chartjs 2.8 and I've created some custom html tooltip for it, now i need to make that tooltip interactive ( aka...
Read more >
Tooltips | Charts - Google Developers
Customizing tooltip content ... In this example, we add custom content to the tooltips by adding a new column to the DataTable and...
Read more >
How To Create Tooltips - W3Schools
Tip: Go to our CSS Tooltip Tutorial to learn more about tooltips. Tip: To create "clickable" tooltips, go to our How To Create...
Read more >
How to create interactive tooltips in Power BI (step by step)
How to create interactive tooltips in Power BI (step by step) · Step 1: Create the main visual · Step 2: Add a...
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