apexcharts / ng-apexcharts

ng-apexcharts is an implementation of apexcharts for angular. It comes with one simple component that enables you to use apexcharts in an angular project.
MIT License
310 stars 78 forks source link

dataPointIndex is always -1 for events triggered on a pie chart #328

Closed Pyknic closed 1 week ago

Pyknic commented 1 month ago

I have created a pie chart with this config:

this.config = {
    chart: {
      ...this.defaultChartConfig(),
      events: {
        click(e: any, chart?: any, options?: any) {
          console.log('Click. Series index: ' + options.seriesIndex + ', data point index: ' + options.dataPointIndex);
        }
      }
    }
  };

Series index and data point index is always -1. For bar charts, it works as expected.

junedchhipa commented 1 week ago

Can you please try with the latest apexcharts version and test again? Also, provide a codepen example in case it didn't work.