0

我正在尝试完成此处显示的内容
http://jsfiddle.net/r7UsK/
基本上我想要一个低于 0 标记的红色背景,以使负值更加突出。
这是我当前的版本
http://jsfiddle.net/7rpMt/
我做错了什么?

JS代码

chartItems = new Array();
chartItems.push(["Civilian Afterburner","2013-05-20 07:05:03","5841223.56"]);
chartItems.push(["Civilian Afterburner","2013-05-20 22:00:59","5841321.12"]);
chartItems.push(["Civilian Afterburner","2013-05-21 22:00:31","5841289.08"]);
chartItems.push(["Civilian Afterburner","2013-05-22 22:01:08","5841566.46"]);
<Data Sniped>
sorted = {};
        $.each(chartItems, function(){
            if(sorted[this[0]] == undefined) sorted[this[0]] = new Array();
            sorted[this[0]].push([Date.parse(this[1]), parseFloat(this[2])]);
        })
        series = []
        $.each(sorted, function(i){
                series.push({
                        type: 'spline',
            name: i,
            data: this,
            marker: {
                radius: 4
            }
                })
        })
        $('#container').highcharts({
            chart: {
            },
            title: {
                text: ''
            },
            xAxis: {
                type: 'datetime',
                dateTimeLabelFormats: { // don't display the dummy year
                    month: '%b %e',
                    year: '%b'
                }
            },
            yAxis: {
                title: {
                    text: 'Profit/Min'
                },
                plotBands: [{
                   from: -1000,
                   to: 0,
                   color: 'rgba(255, 0, 0, 0.5)'
                }]
            },
            series: series
        });
4

1 回答 1

0

您的最小 y 值远小于 -1000。再加 4 个零。

plotBands: [{
  from: -10000000,
  to: 0,
  color: 'rgba(255, 0, 0, 0.5)'
}]

http://jsfiddle.net/7rpMt/1/

于 2013-05-26T16:01:13.750 回答