highchart stacked bar plotting data doesn't work by javascript

前端 未结 1 1186
北海茫月
北海茫月 2020-12-12 05:17

why is this, i am having a trouble in plotting a data in bar highchart. I am using this chart.series[i].addPoint(data[i][\'total_check\']); but when i alert

相关标签:
1条回答
  • 2020-12-12 06:18

    you data seem to be strings, you need to parse them to be numbers.

    You can use this: Convert argument to number

    function getbarseries(month) {
        $.ajax({
          url: siteurl+"patients_report/bardataclinic/"+month,
          type: "POST",
          dataType: "JSON",
            success: function(data) {
               for(var i in data) {
                   chart.series[i].addPoint(Number(data[i]['total_check']));
               }
            }
        });
    }
    
    0 讨论(0)
提交回复
热议问题