Home forums Using CanvasJS Populate Chart datapoints with data from database

Tagged: , ,

This topic contains 0 replies, has 1 voice, and was last updated by  mikespider 1 year, 10 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #7864

    mikespider
    Participant

    I’m trying to populate the chart datapoints with data from database using PHP and Json.

    var exam_grades1 = <?php echo json_encode($exam_grades1 );?>;
    
    for(var key in exam_grades1) {
                var value = exam_grades1[key];
                 
    }

    Then I wanna be able to do something like this:

    ... 
        dataPoints: [
                 
             { label: key, y:  parseFloat(value) },
     ....

    Any help will be greatly appreciated.

    • This topic was modified 1 year, 10 months ago by  mikespider.
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.