Skip to content

Problem with decimals #9361

Answered by kurkle
noroxi7 asked this question in Q&A
Jul 5, 2021 · 2 comments · 7 replies
Discussion options

You must be logged in to vote

For tooltip, you can customize the label with callbacks:

const formatter = new Intl.NumberFormat('en-US', {minimumFractionDigits: 5});
const myChart9 = new Chart(ctx9, {
  type: 'line',
  data: data,
  options: {
    plugins: {
      tooltip: {
        callbacks: {
          label: (item) => item.dataset.label + ': ' + formatter.format(item.parsed.y),
        }
      }
    }
  }
});

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
3 replies
@noroxi7
Comment options

@LeeLenaleee
Comment options

@kurkle
Comment options

Answer selected by noroxi7
Comment options

You must be logged in to vote
4 replies
@noroxi7
Comment options

@LeeLenaleee
Comment options

@noroxi7
Comment options

@kurkle
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #9359 on July 05, 2021 19:52.