Apexcharts.js: chart.hideSeries() does not work in 3.20.1 or later.

Created on 14 Sep 2020  Â·  3Comments  Â·  Source: apexcharts/apexcharts.js

Bug report

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
chart hideSeries_in_3 20 0

in 3.20.1 or later
chart hideSeries_in_3 20 1

Codepen

https://codepen.io/hankei6km/pen/ExKRZzz

Explanation

  • 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
bug

Most helpful comment

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…

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

piyushSinghalDemo picture piyushSinghalDemo  Â·  3Comments

drummad picture drummad  Â·  3Comments

Sumon-miazi picture Sumon-miazi  Â·  3Comments

artfulrobot picture artfulrobot  Â·  3Comments

ismaildervisoglu picture ismaildervisoglu  Â·  3Comments