chart.js – link to other page when click on specific section in chart
You can use getElementAtEvent() method to detect which section/slice of your pie chart was clicked on, and based on that open a link/page accordingly. Here is a quick example : var canvasP = document.getElementById(“pieChart”); var ctxP = canvasP.getContext(‘2d’); var myPieChart = new Chart(ctxP, { type: ‘pie’, data: { labels: [“Värde 1”, “Värde 2”, “Värde 3”, … Read more