# Highlight specific series on stacked chart

**URL:** <https://talk.observablehq.com/t/highlight-specific-series-on-stacked-chart/8165>\
**Category:** Help\
**Created:** [August 9, 2023, 6:52pm UTC](https://talk.observablehq.com/t/highlight-specific-series-on-stacked-chart/8165 "2023-08-09T18:52:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mferro64](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mferro64/32/6421_2.png) [@mferro64](https://talk.observablehq.com/u/mferro64)\
**Post date:** [August 9, 2023, 6:52pm UTC](https://talk.observablehq.com/t/highlight-specific-series-on-stacked-chart/8165/1 "2023-08-09T18:52:43Z")

</div>

I am trying to highlight a specific series in a stacked rect chart. I am able to achieve my goal using a line chart, but would like to be able to do the same thing with the stacked rect chart. I ahve provided an image of the results I am trying to achieve - by selecting “taylor\_swift” in the highlight topic filter I would highlight the “taylor\_swift” series in the stack.

Example: [Analytics 3 / mferro64 | Observable](https://observablehq.com/d/24ee8b8903180e71)

 ![Screen Shot 2023-08-09 at 11.44.55 AM](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/7/74688a5a376f695b698d615413ae3c0f8d92d5b1.png)

---

<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:** [August 10, 2023, 8:41am UTC](https://talk.observablehq.com/t/highlight-specific-series-on-stacked-chart/8165/2 "2023-08-10T08:41:30Z")

</div>

To know which rect to highlight, Plot needs to stack the values, and so it needs to know all of them. I’ve sent you a suggestion that fixes this, in two parts:

- first, make highlight\_topic be the name of the topic (instead of a subset of the data).
- second, use one rectY mark, with conditional formatting

[https://observablehq.com/compare/24ee8b8903180e71...9351edd03cbacff9](https://observablehq.com/compare/24ee8b8903180e71...9351edd03cbacff9)

---

<div class="post-metadata">

**Author:** ![mferro64](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mferro64/32/6421_2.png) [@mferro64](https://talk.observablehq.com/u/mferro64)\
**Post date:** [August 10, 2023, 4:39pm UTC](https://talk.observablehq.com/t/highlight-specific-series-on-stacked-chart/8165/3 "2023-08-10T16:39:24Z")

</div>

Thanks - that is what I was trying to achieve
