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 documentation needs improvements regarding custom tooltips

See original GitHub issue

We should provide more docs on how to use custom tooltips and what problem they are intended to fix.

We should also do a better job documenting what the tooltipItem struct contains

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

10reactions
Jaded-Designcommented, Jun 14, 2016

Until this can be done here are some quick helpers for people looking for answers to common situations:

Here is how to put together a basic label:

 options: {
      animation: false,
           tooltips: {
              callbacks: {
                  label: function (tooltipItem, data) { return data.datasets[tooltipItem.datasetIndex].label + ' - ' + tooltipItem.yLabel}
                    }
                },

And here is how to return a label and then format the number to a currency:

options: {
  animation: false,
  tooltips: {
        callbacks: {
            label: function (tooltipItem, data) { return data.datasets[tooltipItem.datasetIndex].label + ' - ' + '$' + Number(tooltipItem.yLabel).toFixed(0).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");}
                    }
                },
0reactions
etimbergcommented, Mar 21, 2017

Fixed in #3751

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building a tooltip component - web.dev
A foundational overview of how to build a color-adaptive and accessible tooltip custom element.
Read more >
Create Views for Tooltips (Viz in Tooltip)
These steps use the example of a source view that is a map showing sales profits by state, and a target sheet with...
Read more >
Amazon QuickSight launches Custom Tooltips, Updates to ...
Custom tooltips provide additional context to any visuals with more dimensions and metrics added beyond those already available on the visual.
Read more >
Tooltips in the time of WCAG 2.1
Before diving into the details of how to implement a custom tooltip, let's take a moment to define what a tooltip really is....
Read more >
Tooltip Component
The example below demonstrates how to provide custom tooltips to the grid. Notice the following: The Custom Tooltip Component is supplied by name...
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