Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • http://fkiattendance.xyz/staff_report.php

    this is the link to my chart.

    <script type=”text/javascript”>
    window.onload = function () {
    var chart = new CanvasJS.Chart(“chartContainer”,{
    title:{
    text:”Rendering Multi Series Chart from database”
    },
    data: [{
    type: “column”,
    dataPoints : [],
    }]
    });

    $.getJSON(“report.php”, function(data) {
    $.each((data), function(key, value){
    chart.options.data[0].dataPoints.push({label: value[0], y: parseInt(value[1])});
    });
    chart.render();
    updateChart();
    });

    function updateChart() {
    $.getJSON(“report.php”, function(data) {
    chart.options.data[0].dataPoints = [];
    chart.options.data[1].dataPoints = [];
    $.each((data), function(key, value){
    chart.options.data[0].dataPoints.push({label: value[0], y: parseInt(value[1])});
    });

    chart.render();
    });
    }

    setInterval(function(){updateChart()}, 1000);
    }
    </script>

    it still wont come render.

Viewing 1 post (of 1 total)