An error occurred when calling chart.hideSeries(seriesName) in apexcharts.js 3.20.1 or later
and the specified series has not been hidden.
in 3.20.0

in 3.20.1 or later

https://codepen.io/hankei6km/pen/ExKRZzz
What is the behavior you expect?
The specified series will been hidden.
What is happening instead?
The specified series is not hidden.
What error message are you getting?
No message outputed in codepen console.
However, below message was outputed in browser console.
apexcharts:6 Uncaught TypeError: Cannot read property 'getAttribute' of null
at t.value (apexcharts:6)
at t.value (apexcharts:6)
at t.value (apexcharts:14)
at pen.js:23
value @ apexcharts:6
value @ apexcharts:6
value @ apexcharts:14
(anonymous) @ pen.js:23
I am experiencing this issue too. It seems that the attribute data:realIndex is not present on the .apexcharts-legend-series element, which, as I understood, is used later to locate the series in the dom. Maybe that helps a little bit…
You're right.
It was selecting legend instead of series in querySelector. Thanks for the hint.
Thank you for the quick fix.
Most helpful comment
I am experiencing this issue too. It seems that the attribute
data:realIndexis not present on the.apexcharts-legend-serieselement, which, as I understood, is used later to locate the series in the dom. Maybe that helps a little bit…