2015-07-20 147 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

相关问题