2013-05-26 35 views
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 
     }); 

回答

0

你分鐘y值是遠遠小於-1000。再加4個零。

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

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