2013-08-29 60 views
1

我做highcharts汽油罐(信用卡預付款)highcharts溢出分組

我想使每行應該從棒替代分組末(加入)的從頭開始。(我不噸需要擁有所有數據的總和)

enter image description here

感謝。

![var options = { 
       chart: { 
        type: 'bar', 
        height: 300, 
        width:420 
       }, 
       title: { 
        text: 'Prepayment' 
       }, 
       yAxis: { 
        gridLineColor: '#eee', 
        title: { 
         text: 'Prepayment' 
        } 
       }, 
       xAxis: { 
        categories: \['Credit'\], 
        labels: { 
         step: 0, 
         rotation: -45, 
         align: 'right' 
        } 
       }, 
       legend: { 
        enabled: true 
       }, 
       tooltip: { 
        shared: true, 
        crosshairs: true 
       }, 
       plotOptions: { 
        series: { 
         stacking: 'normal' 
        } 
       }, 
       credits: { 
        enabled: false 
       }, 
       series: \[{ 
        color:'#89C35C', 
        name: 'Current Credit', 
        data: \[10\]    }, { 
        color:'#FFD801', 
        name: 'Warning Threshold', 
        data: \[5\]    }, { 
        color:'#E42217', 
        name: 'Cut-Off Threshold', 
        data: \[1\]    }\], 
      }; 
$('#container').highcharts(options);][1] 

例子: http://jsfiddle.net/2se5q/

+0

你需要禁用堆積選項 –

回答

1

我做了這個樣子,其中type =面積

http://jsfiddle.net/2se5q/4/

enter image description here

var options = { 
       chart: { 
        type: 'area', 
        height: 300, 
        width:420 
       }, 
       title: { 
        text: 'Prepayment' 
       }, 
       yAxis: { 
        gridLineColor: '#eee', 
        title: { 
         text: 'Prepayment' 
        } 
       }, 
       xAxis: { 
        categories: ['Credit'], 
        labels: { 
         step: 0, 
         rotation: -45, 
         align: 'right' 
        } 
       }, 
       legend: { 
        enabled: true 
       }, 
       tooltip: { 
        shared: true, 
        crosshairs: true 
       }, 
       plotOptions: { 
        series: { 
         stacking: 'normal' 
        } 
       }, 
       credits: { 
        enabled: false 
       }, 
       series: [{ 
        color:'#89C35C', 
        name: 'Current Credit', 
        data: [10,10]    }, { 
        color:'#FFD801', 
        name: 'Warning Threshold', 
        data: [5,5]    }, { 
        color:'#E42217', 
        name: 'Cut-Off Threshold', 
        data: [1,1]    }], 
      }; 
$('#container').highcharts(options); 
2

,你會發現所有這些鏈接http://api.highcharts.com/highcharts 的解釋,回答你的問題,如果你只刪除「plotOptions:」你不會找到比圖形的總和上一條線,但從0

這裏開始:http://jsfiddle.net/2se5q/3/

plotOptions: { 
    series: { 
    stacking: 'normal' 
} 
+0

我需要把它在一個行,而不是分開的線 – Oyeme