@@ -132,7 +132,7 @@ export default class Series {
132
132
const w = this . w
133
133
134
134
const targetElement = this . getSeriesByName ( seriesName )
135
- let realIndex = parseInt ( targetElement . getAttribute ( 'data:realIndex' ) , 10 )
135
+ let realIndex = parseInt ( targetElement ? .getAttribute ( 'data:realIndex' ) , 10 )
136
136
137
137
let allSeriesEls = w . globals . dom . baseEl . querySelectorAll (
138
138
`.apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis`
@@ -168,7 +168,7 @@ export default class Series {
168
168
allSeriesEls [ se ] . classList . add ( this . legendInactiveClass )
169
169
}
170
170
171
- if ( seriesEl !== null ) {
171
+ if ( seriesEl ) {
172
172
if ( ! w . globals . axisCharts ) {
173
173
seriesEl . parentNode . classList . remove ( this . legendInactiveClass )
174
174
}
@@ -181,6 +181,10 @@ export default class Series {
181
181
if ( yaxisEl !== null ) {
182
182
yaxisEl . classList . remove ( this . legendInactiveClass )
183
183
}
184
+ } else {
185
+ for ( let se = 0 ; se < allSeriesEls . length ; se ++ ) {
186
+ allSeriesEls [ se ] . classList . remove ( this . legendInactiveClass )
187
+ }
184
188
}
185
189
}
186
190
@@ -196,7 +200,7 @@ export default class Series {
196
200
if ( e . type === 'mousemove' ) {
197
201
let realIndex = parseInt ( targetElement . getAttribute ( 'rel' ) , 10 ) - 1
198
202
199
- this . highlightSeries ( w . config . series [ realIndex ] . name )
203
+ this . highlightSeries ( w . globals . seriesNames [ realIndex ] )
200
204
} else if ( e . type === 'mouseout' ) {
201
205
for ( let se = 0 ; se < allSeriesEls . length ; se ++ ) {
202
206
allSeriesEls [ se ] . classList . remove ( this . legendInactiveClass )
0 commit comments