Format values, tooltips and legends in API-based charts

Hello everyone

Expected behavior

I would like to be able to format values in € in API-based single value charts.
Capture d’écran 2021-07-21 à 15 13 13

I would like to be able to format tooltips and legends in other API-based charts like in the screenshot bellow. (tooltips in € and numbers with spaces in legends) (If I’m not mistaken, legends numbers have spaces at the base in chart.js)


I’m using chart.js on a project and I wanted to know if it’s possible to use the options object to format tooltips :

new Chart(chart, {
 type,
 data,
 options: {
  plugins: {
   tooltip: {
    callbacks: {
     label: ({ raw: value }) => {
      return new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR' }).format(value)
     }
    }
   }
  }
 }
}

Actual behavior single value charts


Simple charts can format numbers under the hood if it’s a price display like in the screenshot. But it seems that I can’t do the same thing with API-based chart. (I need more options than simple charts gives me)

Actual behavior other charts


It seems that other API-based charts, like time based charts in the screenshot, doesn’t allow to change tooltips and legends on the left.

Context

  • Package Version: 7.0.0
  • Express Version: 4.17.1
  • Sequelize Version: 5.15.1

Thanks in advance

Also, the format of objective API-based chart isn’t the same between the value and the objective
Capture d’écran 2021-07-22 à 17 45 34
Is this possible to change format for the value ?

Hello @MarcoGarcia :wave:

Welcome to our community :tada: :confetti_ball:

Sorry, you have been forgotten by the support team. A colleague will respond as soon as possible.

Kind regards,
Morgan

Hi @MarcoGarcia,

Sorry for the delay. I’ll try to reproduce your issue and come back to you as soon as possible :wink:

Sadly I just tried and there is no support right now for custom format.
I’ll push your feedback to productboard

Hello @vince,
thank you, I’ll wait for it :slight_smile:

1 Like