# Tooltip labeling for plot fills

**URL:** <https://talk.observablehq.com/t/tooltip-labeling-for-plot-fills/9168>\
**Category:** Help\
**Created:** [April 19, 2024, 5:23pm UTC](https://talk.observablehq.com/t/tooltip-labeling-for-plot-fills/9168 "2024-04-19T17:23:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jikaczmarski](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jikaczmarski](https://talk.observablehq.com/u/jikaczmarski)\
**Post date:** [April 19, 2024, 5:23pm UTC](https://talk.observablehq.com/t/tooltip-labeling-for-plot-fills/9168/1 "2024-04-19T17:23:26Z")

</div>

Hi there,

I’m trying to figure out how to change the label on my tooltip fills:

 ![Screenshot 2024-04-19 at 9.17.10 AM](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/c/ca2f1a7166ef2cf11f3afa68e75d6388a5ccee10.png)

I can change the labels of the other series using the `channels:` option in my plot mark, but I can’t get them to stick for the fill. For reference, I’m plotting tips following this general structure,

```auto
Plot.plot({
  marks: [
    Plot.barY(
      x: "x",
      y: "y",
      fill: "fuel_type",
      channels: {'Percentage Point Change':"x", Region:"y", 'Fuel Type':"fuel_type"},
      tip: true
    )
  ]
})

```

If anyone has advice on changing the label of the fill in the Plot call then let me know!

---

<div class="post-metadata">

**Author:** ![MP\_Li](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mp_li/32/8722_2.png) [@MP\_Li](https://talk.observablehq.com/u/MP_Li)\
**Post date:** [April 19, 2024, 8:28pm UTC](https://talk.observablehq.com/t/tooltip-labeling-for-plot-fills/9168/3 "2024-04-19T20:28:09Z")

</div>

One way I can think of is just by renaming the key to “Fuel Type”, i.e.:  
`[{x: <x value>, y: <y value>, "Fuel Type": <fuel type value>}]`

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/7/74a2df76e1e19fed779bebc83a5f3cd95afdb4c8.png)

---

<div class="post-metadata">

**Author:** ![jikaczmarski](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jikaczmarski](https://talk.observablehq.com/u/jikaczmarski)\
**Post date:** [April 19, 2024, 9:32pm UTC](https://talk.observablehq.com/t/tooltip-labeling-for-plot-fills/9168/4 "2024-04-19T21:32:26Z")

</div>

That worked perfectly. Thank you for your feedback! Hopefully in the future this can be built directly into plot options. Maybe I’ll take a look at the code and see if it would be easy enough to contribute to.

---

<div class="post-metadata">

**Author:** ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)\
**Post date:** [April 20, 2024, 1:39pm UTC](https://talk.observablehq.com/t/tooltip-labeling-for-plot-fills/9168/5 "2024-04-20T13:39:13Z")

</div>

You could add a **label** option to the color scale option.

---

<div class="post-metadata">

**Author:** ![MP\_Li](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mp_li/32/8722_2.png) [@MP\_Li](https://talk.observablehq.com/u/MP_Li)\
**Post date:** [April 22, 2024, 2:33pm UTC](https://talk.observablehq.com/t/tooltip-labeling-for-plot-fills/9168/6 "2024-04-22T14:33:12Z")

</div>

Thank you! Yes, this is the built-in approach I wasn’t aware of.
