How can i load external json file in highcharts for making bar chart

 ̄綄美尐妖づ 提交于 2019-12-12 02:03:42

问题


I have tried to load JSON file from external link in Highcharts. I am doing this code by referring the example given in Highcharts website,but when I loading the web page,it doesn't show any bar chart and when opening console there is no error found.I have following type of json data.

 [
    {
    "Country_Name": "MYANMAR",
    "value": [
        143
    ]
},
{
    "Country_Name": "MONGOLIA",
    "value": [
        46
    ]
},
{
    "Country_Name": "ZIMBABWE",
    "value": [
        1
    ]
},
{
    "Country_Name": "Bahrain",
    "value": [
        1
    ]
  }
  ]




  $(document).ready(function() {

      var options = {
        chart: {
         renderTo: 'container',
          type: 'spline'
      },
       series: [{}]
   };  

       $.getJSON('try.json', function(data) {
        options.series[0].data = data;
        var chart = new Highcharts.Chart(options);
    });

    });

来源:https://stackoverflow.com/questions/24608983/how-can-i-load-external-json-file-in-highcharts-for-making-bar-chart

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!