# Disable tap-to-hide behavior in legend? (Perspective XY Chart)

**URL:** <https://forum.inductiveautomation.com/t/disable-tap-to-hide-behavior-in-legend-perspective-xy-chart/55738>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 3, 2022, 11:55pm UTC](https://forum.inductiveautomation.com/t/disable-tap-to-hide-behavior-in-legend-perspective-xy-chart/55738 "2022-02-03T23:55:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sho](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@sho](https://forum.inductiveautomation.com/u/sho)\
**Post date:** [February 3, 2022, 11:55pm UTC](https://forum.inductiveautomation.com/t/disable-tap-to-hide-behavior-in-legend-perspective-xy-chart/55738/1 "2022-02-03T23:55:31Z")

</div>

In the Perspective XY chart, tapping/clicking on an icon in the legend hides the corresponding series. Is it possible to disable this behavior?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 5, 2022, 10:58pm UTC](https://forum.inductiveautomation.com/t/disable-tap-to-hide-behavior-in-legend-perspective-xy-chart/55738/2 "2022-02-05T22:58:32Z")

</div>

It doesn’t look like the state of the legend click-to-hide can be seen and therefore can’t be set.

You could disable the built-in legends using  
`props.series.0.hiddenInLegend: true`  
and create the legend manually using labels.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [February 7, 2022, 8:24am UTC](https://forum.inductiveautomation.com/t/disable-tap-to-hide-behavior-in-legend-perspective-xy-chart/55738/3 "2022-02-07T08:24:12Z")

</div>

Idk if it might disable some other click events on the chart though. Let me know if it does, and which setting caused it! (also might not work on old devices)

You can try adding this to your custome theme.css styles…  
`div[data-component="ia.chart.xy"] g[aria-describedby$="description"] > g > g[role="switch"]{pointer-events:none;}`

or maybe easier css injection, paste this in a styleclass background image:  
`}div[data-component="ia.chart.xy"] g[aria-describedby$="description"] > g > g[role="switch"]{pointer-events:none;}{`

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/a/aa5fd9e089723fc48d9f5d250915877dd8dbca3c.png)

---

<div class="post-metadata">

**Author:** ![piotr.ziolkowski](https://avatars.discourse-cdn.com/v4/letter/p/e0b2c6/32.png) [@piotr.ziolkowski](https://forum.inductiveautomation.com/u/piotr.ziolkowski)\
**Post date:** [January 2, 2023, 3:09pm UTC](https://forum.inductiveautomation.com/t/disable-tap-to-hide-behavior-in-legend-perspective-xy-chart/55738/4 "2023-01-02T15:09:16Z")

</div>

I used the second method you described some time ago - thank you for posting it.  
Today I've noticed that it doesn't work anymore. Recently I've upgraded the gateway to from 8.1.14 to 8.1.23, and I think that's why. Now I need to find some other workaround for this.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [January 3, 2023, 7:51am UTC](https://forum.inductiveautomation.com/t/disable-tap-to-hide-behavior-in-legend-perspective-xy-chart/55738/5 "2023-01-03T07:51:36Z")

</div>

no idea what changed, maybe they updated the chart and its named different
