# XY Chart legend and axis clicks

**URL:** <https://forum.inductiveautomation.com/t/xy-chart-legend-and-axis-clicks/52753>\
**Category:** Ignition\
**Created:** [November 4, 2021, 9:11pm UTC](https://forum.inductiveautomation.com/t/xy-chart-legend-and-axis-clicks/52753 "2021-11-04T21:11:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShaneH](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@ShaneH](https://forum.inductiveautomation.com/u/ShaneH)\
**Post date:** [November 4, 2021, 9:11pm UTC](https://forum.inductiveautomation.com/t/xy-chart-legend-and-axis-clicks/52753/1 "2021-11-04T21:11:41Z")

</div>

In Perspective 8.1.10

Using an XY Chart with a legend to display multiple series with multiple y-axis.

The XY Chart has a built-in function to hide a series by clicking on the series name in the legend.

When all the series associated with a particular y-axis are hidden, I would like the y-axis to be hidden as well.

There doesn’t seem to be any notification or property change when a series is hidden this way for me to catch to hide the associated y-axis my self

My only thought is to create my own legend manually and catch the clicks that way, and change the relative series and axis “visible” properties to hide or show them – but this seems tedious, and I worry about the re-render speed.

Any ideas?  
Thanks.

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [March 17, 2022, 5:11am UTC](https://forum.inductiveautomation.com/t/xy-chart-legend-and-axis-clicks/52753/2 "2022-03-17T05:11:13Z")

</div>

Did you get anywhere with this?  
I also note that clicking the series name in the legend doesn’t seem to actually change the series properties at all. I would have thought it would toggle the property “visible”. Unless this is just behaviour in the designer?

---

<div class="post-metadata">

**Author:** ![ShaneH](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@ShaneH](https://forum.inductiveautomation.com/u/ShaneH)\
**Post date:** [March 17, 2022, 12:20pm UTC](https://forum.inductiveautomation.com/t/xy-chart-legend-and-axis-clicks/52753/3 "2022-03-17T12:20:40Z")

</div>

I ended up creating a custom legend view. I hide the legend in the xy chart and display my custom legend below the chart. I then catch the clicks on the legend and adjust the axis properties (visible, tooltip, grid opacity, inside, etc.) to hide the associated axis.

Tricky part was keeping colors, etc. in sync.

HTH.  
-Shane
