<!doctype html>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
<script>
    function plotChart(divId, chartData) {
        // Convert from stringified html, to valid JSON
        const chartDetails = JSON.parse(chartData.replace(/&quot;/g,'"'));
        new Chart(document.getElementById(divId), {
            type: chartDetails.type,
            data: {
                labels: chartDetails.labels,
                datasets: chartDetails.datasets
            },
     