2016-05-18 32 views
0

在以下JSfiddle我製作了一個重疊列的圖表。但是現在圖表中的所有列都是重疊的。我正在介紹兩個小組。這些團體我不想過多。HighChart重疊列但有兩個組

因爲我已經使用重疊:

plotOptions: { 
       column: { 
        grouping: false, 
        shadow: false 
       } 
      } 

這就是我想要實現。 enter image description here

+1

http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/column-stacked-and-grouped/ –

+0

我不想疊加列。我想重疊列 – Kamran

回答

0

不能完全確定,如果你想第二列是上打鉤或一個類別。如果在勾號上,那麼上面的答案應該這樣做,否則here。 點放置和點填充有訣竅。

series: [{ 
     name: 'Employees', 
     color: 'rgba(165,170,217,0.5)', 
     data: [150, 200], 
     pointPadding: 0.4, 
     pointPlacement: -0.1 
    }, { 
     name: 'Employees Optimized', 
     color: 'rgba(126,86,134,.5)', 
     data: [140, 130], 
     pointPadding: 0.4, 
     pointPlacement: -0.1 
    }, { 
     name: 'Profit', 
     color: 'rgba(248,161,63,0.5)', 
     data: [183.6, 189], 
     pointPadding: 0.4, 
     pointPlacement: 0.1, 

    }, { 
     name: 'Profit Optimized', 
     color: 'rgba(186,60,61,.5)', 
     data: [203.6, 190], 
     pointPadding: 0.4, 
     pointPlacement: 0.1, 

    }] 
0

您應該聲明「堆棧」之間的距離爲pointPlacement param。

series: [{ 
      name: 'Stockholm - Sweden', 
      data: [149.9, 171.5, 106.4 ], 
      pointPlacement: 0.5 
     }, { 
      name: 'Linköping - Sweden', 
      data: [83.6, 78.8, 98.5], 
      pointPlacement: 0.5 
     }, 
     { 
      name: 'Hamburg - Germany', 
      data: [183.6, 718.8, 918.5] 
     }, 
     { 
      name: 'Berlin - Germany', 
      data: [831.6, 718.8, 981.5] 
     }] 

例子: