# Format values, tooltips and legends in API-based charts

**URL:** <https://community.forestadmin.com/t/format-values-tooltips-and-legends-in-api-based-charts/3168>\
**Category:** Help me!\
**Created:** [August 27, 2021, 7:49am UTC](https://community.forestadmin.com/t/format-values-tooltips-and-legends-in-api-based-charts/3168 "2021-08-27T07:49:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarcoGarcia](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/marcogarcia/32/2715_2.png) [@MarcoGarcia](https://community.forestadmin.com/u/MarcoGarcia)\
**Post date:** [August 27, 2021, 7:49am UTC](https://community.forestadmin.com/t/format-values-tooltips-and-legends-in-api-based-charts/3168/1 "2021-08-27T07:49:40Z")

</div>

Hello everyone

## Expected behavior

I would like to be able to format values in € in API-based single value charts.  
 ![Capture d’écran 2021-07-21 à 15 13 13](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/4/46d8001dd56f27944e3acba6ef2a7a52eac1c36e.png)

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)

 ![Capture d’écran 2021-07-21 à 15 30 49](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/9/971b3aebc1163310c65d707d4f5562f0136659fc.png)  
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 :

```javascript
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

 ![Capture d’écran 2021-07-21 à 14 39 22](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/0/0f3870b14846e6c5701a89b762ab0a6366615ec6.png)  
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

 ![Capture d’écran 2021-07-21 à 14 45 53](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/8/845c6e14f09b11f65005924f3247698d2c33f62e.png)  
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’écran 2021-07-22 à 17 45 34](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/6/624d89a35c24008730091b51bb22ad0ef3ed068e.png)  
Is this possible to change format for the value ?

---

<div class="post-metadata">

**Author:** ![morganperre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/morganperre/32/1296_2.png) [@morganperre](https://community.forestadmin.com/u/morganperre)\
**Post date:** [September 1, 2021, 10:14am UTC](https://community.forestadmin.com/t/format-values-tooltips-and-legends-in-api-based-charts/3168/2 "2021-09-01T10:14:05Z")

</div>

Hello @MarcoGarcia 👋

Welcome to our community 🎉 🎊

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

Kind regards,  
Morgan

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [September 1, 2021, 12:14pm UTC](https://community.forestadmin.com/t/format-values-tooltips-and-legends-in-api-based-charts/3168/3 "2021-09-01T12:14:38Z")

</div>

Hi @MarcoGarcia,

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

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [September 1, 2021, 2:44pm UTC](https://community.forestadmin.com/t/format-values-tooltips-and-legends-in-api-based-charts/3168/4 "2021-09-01T14:44:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MarcoGarcia](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/marcogarcia/32/2715_2.png) [@MarcoGarcia](https://community.forestadmin.com/u/MarcoGarcia)\
**Post date:** [September 2, 2021, 8:20am UTC](https://community.forestadmin.com/t/format-values-tooltips-and-legends-in-api-based-charts/3168/5 "2021-09-02T08:20:46Z")

</div>

Hello @anon62739609,  
thank you, I’ll wait for it 🙂
