2017-08-01 98 views
-1

餅圖,如何禁用線指向外餅圖如何在highcharts禁用餅圖指針在highcharts

enter image description here

餅圖例如

Highcharts.chart('container', { 
 
    chart: { 
 
     plotBackgroundColor: null, 
 
     plotBorderWidth: null, 
 
     plotShadow: false, 
 
     type: 'pie' 
 
    }, 
 
    title: { 
 
     text: 'Browser market shares January, 2015 to May, 2015' 
 
    }, 
 
    tooltip: { 
 
     pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' 
 
    }, 
 
    plotOptions: { 
 
     pie: { 
 
      allowPointSelect: true, 
 
      cursor: 'pointer', 
 
      dataLabels: { 
 
       enabled: true, 
 
       format: '<b>{point.name}</b>: {point.percentage:.1f} %', 
 
       style: { 
 
        color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' 
 
       } 
 
      } 
 
     } 
 
    }, 
 
    series: [{ 
 
     name: 'Brands', 
 
     colorByPoint: true, 
 
     data: [{ 
 
      name: 'Microsoft Internet Explorer', 
 
      y: 56.33 
 
     }, { 
 
      name: 'Chrome', 
 
      y: 24.03, 
 
      sliced: true, 
 
      selected: true 
 
     }, { 
 
      name: 'Firefox', 
 
      y: 10.38 
 
     }, { 
 
      name: 'Safari', 
 
      y: 4.77 
 
     }, { 
 
      name: 'Opera', 
 
      y: 0.91 
 
     }, { 
 
      name: 'Proprietary or Undetectable', 
 
      y: 0.2 
 
     }] 
 
    }] 
 
});
<script src="https://code.highcharts.com/highcharts.js"></script> 
 
<script src="https://code.highcharts.com/modules/exporting.js"></script> 
 

 
<div id="container" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>
fiddle

+0

您的問題將需要認真重寫理解 – Les

+0

@Les在圖像上面給出,我不需要餅圖外指向的箭頭標記。 – Drella

回答

0

其中一個選項是禁用的標籤。檢查下面的設置:

 

    plotOptions: { 
      pie: { 
       allowPointSelect: true, 
       cursor: 'pointer', 
       dataLabels: { 
        enabled: false, 
        format: '{point.name}: {point.percentage:.1f} %', 
        style: { 
         color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' 
        } 
       } 
      } 
     }, 

或者爲了實現沒有連接器使用下面的代碼。 距離:0將解決這個目的

<pre> 
plotOptions: { 
     pie: { 
      allowPointSelect: true, 
      cursor: 'pointer', 
      dataLabels: { 
      distance:0, 
       enabled: true, 
       format: '<b>{point.name}</b>: {point.percentage:.1f} %', 
       style: { 
        color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' 
       } 
      } 
     } 
    },