Highcharts服务器发布请求问题

时间:2013-08-13 13:52:38

标签: post highcharts http-post

我发送了一个帖子请求到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请求在其他几个月中工作。

Failed Graph

Succsessful Graph

有什么想法吗?

Longer Post Request

2 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分:0)

结果我需要在highcharts配置中禁用或增加turboThreshold

Turbo Threshold

示例:

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.

相关问题