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

Linking to a specific part of a web page

Just append a # followed by the ID of the <a> tag (or other HTML tag, like a <section>) that you’re trying to get to. For example, if you are trying to link to the header in this HTML: <p>This is some content.</p> <h2><a id=”target”>Some Header</a></h2> <p>This is some more content.</p> You could use the … Read more