2015-07-20 66 views
0

線條系列沒有正確匹配。HighCharts線條系列無法正確顯示堆疊酒吧組合圖表

$(function() { 
    $('#container').highcharts({ 
    title: { 
     text: 'Combination chart' 
    }, 
    xAxis: { 
     categories: ['Apples', 'Oranges', 'Pears', 'Bananas', 'Plums'] 
    }, 
    labels: { 
     items: [{ 
      html: 'Total fruit consumption', 
      style: { 
       left: '50px', 
       top: '18px', 
       color: (Highcharts.theme && Highcharts.theme.textColor) || 'black' 
      } 
     }] 
    }, 
    plotOptions: { 
     series: { 
      stacking: 'normal' 
     } 
    }, 
    series: [{ 
     type: 'column', 
     name: 'Jane', 
     data: [3, 2, 1, 3, 4], 
     stack: 0 
    }, { 
     type: 'column', 
     name: 'John', 
     data: [2, 3, 5, 7, 6], 
     stack: 0 
    }, { 
     type: 'column', 
     name: 'Joe', 
     data: [4, 3, 3, 9, 0], 
     stack: 0 
    }, { 
     type: 'line', 
     name: 'Average', 
     data: [3, 2.67, 3, 6.33, 3.33], 
     marker: { 
      lineWidth: 2, 
      lineColor: Highcharts.getOptions().colors[3], 
      fillColor: 'white' 
     } 
    }, { 
     type: 'line', 
     name: 'Total consumption', 
     data: [3, 2.67, 3, 6.33, 3.33], 
     center: [100, 80], 
     size: 100, 
     showInLegend: false, 
     dataLabels: { 
      enabled: false 
     } 
    }] 
    }); 
}); 

這裏有一個小提琴,顯示我在做什麼:

http://jsfiddle.net/tn7b0fb0/

的號碼爲行的都是一樣的,他們爲什麼不上海誓山盟的頂部?

如果你摧毀了條形圖,它看起來是正確的。

回答

1

從plotOptions中刪除stacking: 'normal',並將其單獨應用於一系列級別,僅適用於該列系列。

Updated Jsfiddle

相關問題