HighCharts:相同图形问题中的区域范围和样条曲线

时间:2013-04-26 21:28:49

标签: javascript highcharts

基于“区域范围和线”演示,我创建了以下示例代码:

            Highcharts.setOptions({
                global: {
                    useUTC: false
                }
            });

            var opts = {
                chart: {
                    renderTo: 'gfx',
                    zoomType: 'x'
                },
                title: {
                    text: 'Archived data'
                },
                xAxis: {
                    type: 'datetime'
                },
                tooltip: {
                    crosshairs: true,
                    shared: true
                },
series:[
{"name":"cpuload (1 minute)", "type":"spline",
"data":[
    [1364688000000,0.319545],
    [1364742000000,0.195],
    [1364752800000,0.144],
    [1364756400000,0.266],
    [1364767200000,0.245],
    [1364770800000,0.184286],
    [1364774400000,0.1],
    [1364832000000,0.33],
    [1364857200000,0.16],
    [1364896800000,0.249091]
],
"zIndex":1,
},
{ name: "Range",
"type":"arearange",
"data":[
    [1364688000000,0.02,0.55],
    [1364742000000,0.1,0.29],
    [1364752800000,0.08,0.22],
    [1364756400000,0.19,0.33],
    [1364767200000,0.11,0.38],
    [1364770800000,0.08,0.41],
    [1364774400000,0.1,0.1],
    [1364832000000,0.33,0.33],
    [1364857200000,0.09,0.23],
    [1364896800000,0.31,0.31]
],
lineWidth: 0,
"linkedTo":":previous",
"zIndex":0,
"fillOpacity":0.3
}
]
            }
            chart = new Highcharts.Chart(opts);

但没有创建图表。没有错误消息,但没有图形:( 如果我改变“type”:“arearange”,改为“type”:“spline”,我得到一个图形,有2行(如预期的那样)。 我坚持了2天没有运气:(

任何提示,想法代码?

由于

劳伦

1 个答案:

答案 0 :(得分:2)

您使用的是highcharts-more.js吗?

<script src="http://code.highcharts.com/highcharts-more.js"></script>

http://jsfiddle.net/pLDeq/12/