Hi,
I would love to have a hide and show method for series, so I can always be sure in what state my series is.
I have multiple legends who all toggle some series. Sometimes more than one. An I had to build a workaround to know which of the series is hidden and which is not.
It would also be great to hide a series on render. Like an additional option in the series configuration.
I have large charts in which the user can filter what he would like to see in the chart.
Per default only one option (series) is visible and the user can show more options if he wishes to.
Greetings
Have you tried the toggleSeries() method? https://apexcharts.com/docs/methods/#toggleSeries
var chart = new ApexCharts(el, {
series: [{
name: 'Football'
data: [33, 23, 76, 33]
}, {
name: 'Cricket'
data: [23, 33, 16, 23]
}]
});
chart.toggleSeries('Football')
Yes, I've tried the toggle Method.
The problem is, I never know where the user is and what state the series is in (toggled or not).
So it is a big Bug trap. Show and hide would solve this problem. Or a "hidden" value which I can adress.
Also initial hiding a Series is pretty complicated to acomplish.
Ok, I will note down as a feature enhancement.
+1 for this.
We need showSeries() and hideSeries()
In addition can we get highlightSeries() as a method?
+1
Could toggleSeries() return true or false depending on the visible state of the series?
+1
I need to hide all series except the first one by default.
Added new methods
showSeries and hideSeries.
Also, toggleSeries will return a boolean value whether the series is hidden or not.
The change will be reflected in the next patch/minor release.
I can't seem to get these methods to work. I made an issue with codepen here #1192
Is showSeries() and hideSeries() available for apexcharts react implementation as well?
I am having a weird issue with showSeries(). Every time I call it the page will automatically scroll up to the top. Can we avoid this?
Most helpful comment
Added new methods
showSeriesandhideSeries.Also,
toggleSerieswill return a boolean value whether the series is hidden or not.The change will be reflected in the next patch/minor release.