Chartjs-ChartJS graph not displaying – line graph

0👍

Step 1 – json data is wrong use The JSON Validator to check.

Here is the correct json data.
[{“0″:”1″,”user_id”:”1″,”1″:”3″,”pain”:”3″,”2″:”3″,”sleep”:”3″,”3″:”3″,”mood”:”3″,”4″:”32″,”heartrate”:”32″,”5″:”2019-06-20 09:52:43″,”time_of_entry”:”2019-06-20 09:52:43″},{“0″:”1″,”user_id”:”1″,”1″:”3″,”pain”:”3″,”2″:”3″,”sleep”:”3″,”3″:”3″,”mood”:”3″,”4″:”32″,”heartrate”:”32″,”5″:”2019-06-20 09:52:53″,”time_of_entry”:”2019-06-20 09:52:53″},{“0″:”1″,”user_id”:”1″,”1″:”2″,”pain”:”2″,”2″:”23″,”sleep”:”23″,”3″:”3″,”mood”:”3″,”4″:”89″,”heartrate”:”89″,”5″:”2019-06-20 09:53:20″,”time_of_entry”:”2019-06-20 09:53:20″}]

Step 2– parse the json data then use. It will work.

Attached the screenshot.
https://www.screencast.com/t/6t4r6hqMTw

  $(document).ready(function(){
              $.ajax({
             url : "**********",
            type : "GET",
        success : function(data){
        data = jQuery.parseJSON( data);

    -------

Leave a comment