How can i load external json file in highcharts fo

2019-09-16 17:51发布

问题:

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);
    });

    });
标签: highcharts