apexcharts / vue-apexcharts

📊 Vue 2 component for ApexCharts
https://apexcharts.com
MIT License
1.34k stars 136 forks source link

Pie / Donut chart events #502

Open meganallas opened 1 year ago

meganallas commented 1 year ago

Events, specifically click and dataPointSelection that I've tested, are not firing for Pie and Donut charts. Did I miss something?

<script lang="ts">
import { defineComponent, onMounted, ref, watch } from "vue";

export default defineComponent({
    setup() {
        const chartOptions = ref<any>({
            chart: {
                type: "donut",
                events: {
                    click: function (event: any, chartContext: any, config: any) {
                        console.log("click");
                    },
                    dataPointSelection: function (event: any, chartContext: any, config: any) {
                        console.log("dataPointSelection");
                    }
                },
            },
        });
        const series = ref<Array<number>>([40, 50, 60, 70]);

        return {
            chartOptions,
            series,
        };
    },
});
</script>

<template>
    <div class="overviewChart">
        <apexchart type="donut" :options="chartOptions" :series="series"></apexchart>
    </div>
</template>

Versions: "apexcharts": "^3.44.0", "vue-apexcharts": "^1.6.2",

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.