Highcharts getJSON不工作

时间:2017-06-27 14:37:16

标签: javascript json highcharts

一直试图让Highcharts工作,但是获得JSON是行不通的......

我的JSON只是从他们的示例中复制数据,但是在我自己的服务器上:

JSON Data

我的Javascript是:

$.getJSON('./servercount.json', function(data) {

  Highcharts.chart('container', {
    chart: {
      zoomType: 'x'
    },
    data: {
      data: data
    },
    title: {
      text: 'CakeBot Stats'
    },
    xAxis: {
      type: 'datetime'
    },
    yAxis: {
      title: {
        text: 'Value'
      }
    },
    legend: {
      enabled: true
    },
    plotOptions: {
      area: {
        fillColor: {
          linearGradient: {
            x1: 0,
            y1: 0,
            x2: 0,
            y2: 1
          },
          stops: [
            [0, Highcharts.getOptions().colors[0]],
            [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
          ]
        },
        marker: {
          radius: 2
        },
        lineWidth: 1,
        states: {
          hover: {
            lineWidth: 1
          }
        },
        threshold: null
      }
    },

    series: [
      {
        type: 'area',
        name: 'Servers',
        data: data
      },
      {
        type: 'area',
        name: 'Members',
        data: data
      }
    ]
  });
});

图表不会加载:http://cakebot.club/stats

有什么想法吗?

0 个答案:

没有答案