0

In the below code I'm hiding the series that contain zero data

  useEffect(() => {
    if (props.bicycleType === "ROAD_BIKE")
      roadBikeSeries.forEach((series) => {
        if (series.data.length === 0) {
          ApexCharts.exec("RoadBike", "hideSeries", series.name);
        } else {
          ApexCharts.exec("RoadBike", "showSeries", series.name);
        }
      });
  }, [roadBikeSeries]);

Based on the screenshot as you can see Straight Up and Lower than TT have 0 data and they are hidden. I want to make them not clickable in my legend. Is it possible to make specific series not clickable?

enter image description here

Strike
  • 77
  • 1
  • 7
  • Have you tried setting [`showForZeroSeries`](https://apexcharts.com/docs/options/legend/#showForZeroSeries) to false? It wouldn't make the series not clickable, but would instead hide the series in the legend. Might be applicable depending on the use case. – Oscar Schafer Aug 23 '23 at 16:05
  • In my case I need to show the legend even if I have zero data. – Strike Aug 23 '23 at 16:08

0 Answers0