0

我正在向 highcharts 服务器发送一个发布请求,但是我没有得到我期望的结果。

{
    title: {
        text: 'Volume Capacity Used (GB)'
    }, 
    subtitle: {
        text: 'For the month of July'
    }, 
    plotOptions: {
        series: { 
            marker: {
                enabled: false
            }
        }
    },
    xAxis: { 
        startOnTick: true, 
        endOnTick: true, 
        showFirstLabel: true, 
        min: 1372636800000, 
        minorTickInterval: 24 * 3600 * 1000, 
        type: 'datetime', 
        title: {
            text: 'Date'
        }
    }, 
    yAxis: [{
        labels: {
            formatter: function(){ 
                return this.value + ' GB';
            }
        }, 
        endOnTick: true, 
        min: 0, 
        max: 1890, 
        title: {
            text: 'Capacity Used (GB)'
        }
    },
    {
        labels:{
            formatter:function(){ 
                var max=1890, min=this.axis.linkedParent.min,range=max-min; 
                return (Math.round((this.value-min)/(range)*100)) + ' %';
            }
        }, 
        linkedTo:0, 
        opposite:true, 
        title: { 
            text: 'Percentage Used (%)'
        }
    }], 
    series: [{
        "data":[{
            "x":1372638600000,
            "y":1362.69
         },
         {
            "x":1372640400000,
            "y":1362.7
         },
         {
            "x":1372643100000,
            "y":1362.7
         },
         {
            "x":1372644900000,
            "y":1362.72
         },
         {
            "x":1372647600000,
            "y":1362.72
         }],
         "name":"GraphName"
    }]
};

我的帖子请求比这大得多,但我删除了一些系列数据,因为我不需要把它们都放在这里。

我期望得到的是一个跨越整个月的图表,但是我得到的是一个只显示 7 月 1 日的图表,没有别的。

我认为这与 POST 请求有关。但是,它确实可以使用具有不同数据的相同 POST 请求在其他几个月内工作。

失败的图表

成功图

有任何想法吗?

更长的帖子请求

4

2 回答 2

0

原来我需要在 highcharts 配置中禁用或增加 turboThreshold

涡轮阈值

例子:

series: [{
    turboThreshold: 10000,
    "data":[{
        "x":1372638600000,
        "y":1362.69
     },
     {
        "x":1372640400000,
        "y":1362.7
     },
     {
        "x":1372643100000,
        "y":1362.7
     },
     {
        "x":1372644900000,
        "y":1362.72
     },
     {
        "x":1372647600000,
        "y":1362.72
     }],
     "name":"GraphName"
}]

要完全禁用它,我会将 turboThreshold 值更改为 0。

于 2013-08-13T20:23:50.977 回答
0

我在这里复制了你的例子:http: //jsfiddle.net/q5aMr/based on your source code)和导出的图表看起来一样。您使用哪种浏览器和 Highcharts 版本?

于 2013-08-13T14:04:38.370 回答