繁体   English   中英

如何从HighCharts饼图中删除白色边框?

[英]How can I remove the white border from HighCharts pie chart?

我使用高图来显示饼图,任何人都可以告诉我如何在半径周围删除这个白色边框。 我的代码下面还给出了图表的屏幕截图。

我对高级图表没有太多经验,如果有人知道,请帮助我。 文档也很难阅读和理解

 $(function () { $('#cashflow_graph').highcharts({ chart: { type: 'pie', backgroundColor:'red', }, title: { text: false }, yAxis: { title: { text: false } }, plotOptions: { pie: { dataLabels: { enabled: false }, shadow: false, center: ['50%', '50%'] }, series: { states: { hover: { enabled: false, halo: { size: 0 } } } }, }, credits: { enabled: false }, tooltip: { enabled: false, valueSuffix: '%' }, series: [{ name: 'Cash Flow', data: [ { name: 'Incoming', y: 40, color: '#87b22e' }, { name: 'Outgoing', y: 30, color: 'black' }, { name: '', y: 30, color: 'white' } ], size: '80%', innerSize: '80%', dataLabels: { enabled: false, formatter: function () { return false; } } }] }); }); 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highcharts/4.1.5/highcharts.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highcharts/4.1.5/highcharts-more.src.js"></script> <div id="cashflow_graph" style="height: 300px; width:100%;"></div> 

在此输入图像描述

您需要将plotOptions.pie.borderWidth属性设置为0

 $(function() { $('#cashflow_graph').highcharts({ chart: { type: 'pie', backgroundColor: 'red', }, title: { text: false }, yAxis: { title: { text: false } }, plotOptions: { pie: { dataLabels: { enabled: false }, shadow: false, center: ['50%', '50%'], borderWidth: 0 // < set this option }, series: { states: { hover: { enabled: false, halo: { size: 0 } } } }, }, credits: { enabled: false }, tooltip: { enabled: false, valueSuffix: '%' }, series: [{ name: 'Cash Flow', data: [{ name: 'Incoming', y: 40, color: '#87b22e' }, { name: 'Outgoing', y: 30, color: 'black' }, { name: '', y: 30, color: 'white' } ], size: '80%', innerSize: '80%', dataLabels: { enabled: false, formatter: function() { return false; } } }] }); }); 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highcharts/4.1.5/highcharts.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highcharts/4.1.5/highcharts-more.src.js"></script> <div id="cashflow_graph" style="height: 300px; width:100%;"></div> 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM