How to hide metrics set on button click

Hello!
I have a chart that contains two sets of data (like a line chart and a histogram). There are two buttons. It is necessary that when the first button is pressed, the line (metric set 1) is hidden on the chart and only the histogram (metric set 2) remains. When the second button was pressed, the line remained, and the histogram disappeared.
Tried using the following script lines:
chart7.control.metricSet (1) .isVisible = false;
chart7.control.metricSet (2) .isVisible = true;
or
$ (chart7.container) .metricSet1.isVisible = false;
$ (chart7.container) .metricSet2.isVisible = true;
I would really appreciate your help.

Hello

To hide or show series in a chart you can do it with:

chart7.control.series[0].isVisible = false;
chart7.control.series[1].isVisible = true;

1 Like

Thanks, this solved the problem