Am using apex chart (radialbar) for display values but when i click for chart redirect to another page with parameter value. but i try below code but selected value return "undefined"
var _majordemo12 = function () { const apexChart = "#majorchart_12"; var options = { series: @Html.Raw(Json.Encode(TempData["chart_majorvalue"])), chart: { width: 380, type: 'radialBar', events: { dataPointSelection: function (event, chartContext, config) { // Get the selected data point's value and redirect to another page var selectedValue = config.w.globals.series[config.seriesIndex][config.dataPointIndex]; console.log(selectedValue); //window.location.href = 'another-page.aspx?selectedValue=' + selectedValue; } } }, labels: @Html.Raw(Json.Encode(TempData["chart_majorname"])), responsive: [{ breakpoint: 480, options: { chart: { width: 200 }, legend: { position: 'bottom' } } }], legend: { position: 'bottom', show: false }, //colors: [ danger, info,primary, success, warning] theme: { palette: 'palette6' // upto palette10 } }; var chart = new ApexCharts(document.querySelector(apexChart), options); chart.render(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)