2014-02-20 40 views
4

Blue circle with whitespace at the top, circled in red.如何從highchart.js中的餅圖中刪除空格?

我想刪除上面以紅色圈起來的白色空格。我使用下面的代碼中的jsfiddle:

$(function() { 

$('#container').highcharts({ 
    chart: { 
     plotBackgroundColor: null, 
     plotBorderWidth: null, 
     plotShadow: false,borderRadius: 0, 
        borderWidth:0, 
    }, 
    title: { 
     text: 'Browser market shares at a specific website, 2010' 
    }, 
    tooltip: false, 
    plotOptions: { 
     pie: { 
      allowPointSelect: true, 
      cursor: 'pointer', 
      dataLabels: { 
       enabled: true, 
       color: '#000000', 
       connectorColor: '#000000', 
       format: '<b>{point.name}</b>: {point.percentage:.1f} %' 
      } 
     } 
    }, 
    series: [{ 
     type: 'pie', 
     name: 'Browser share', 
     size: '115%', 
     innerSize: '110%', 
     data: [ 
      ['Firefox', 45.0] 

     ] 
    },{type: 'pie', 
     name: 'Browser share', 
     size: '100%', 
         innerSize: '98%', 
     data: [ 
      ['Firefox', 45.0] 

     ]} 
]}); 
}); 

小提琴:在情節選項http://jsfiddle.net/jF22s/

回答

2

不幸的是它是已知的bug報告here

5

使用borderWidth :0

pie: { 
     allowPointSelect: true, 
     cursor: 'pointer', 

     borderWidth: 0, // This removes the border 

更新小提琴:http://jsfiddle.net/jF22s/5/

如果這是不能接受的(因爲它仍然有一個非常微小的間隙),加上同色圖表的邊界,這將刪除所有的空間:

borderWidth: 1, 
borderColor:'#2F7ED8', 

小提琴http://jsfiddle.net/jF22s/15/

+0

對於它仍然extists。 –

+0

@ SebastianBochan補充了另一個竅門來克服這一點。 – DhruvPathak

+0

感謝您的回覆。 –