Now you need to add your chart code into the footer in the page settings. To get the chart you want, you will need to be able to read / work with / write JS, or at least understand the Chart.js documentation.
new Chart(document.getElementById(“donut”), {
“type”: “doughnut”,
“data”: {
“labels”: [“Year to Date”, “Target”, "Year "],
“datasets”: [{
“label”: “Progress Year to date”,
“data”: [100, 80, 270],
“backgroundColor”: [“rgb(56, 232, 180)”, “rgb(0, 174, 239)”, “rgb(227, 227, 227)”]
}]
}
});
With some difficulty I have managed to implement the chartjs solution after a couple of hours of troubleshooting!
Just in case there is anyone visiting this post I think there are some problems with your code above as I just couldn’t get it to work, there seems to be some differences with the code I eventually got to work for a doughnut:
Anyone trying to implement this can visit two useful sites, the chartjs getting started page:
You can then go to an individual chart page like this for doughnuts:
Also here is a useful page with examples of the full code you need for each sort which was useful for me as I am not a coder and the chartjs site gives examples but not full as they presume you can fill in the gaps!
The script calling js file from cloudflare goes in the custom code field for header in site settings or the inside header tag on the page settings
The code with the chart options goes into the beforetag field in page options
The canvas id code goes into the HTML embed document custom code field (make sure you use the same ID as you have called out in the chart details, in my example above it is “doughnut-chart”). Give your DIV some width and height.