Google Pie chart: remove white gap between pie slices

。_饼干妹妹 提交于 2019-12-22 07:03:06

问题


Similar to this question, but for Google Pie Charts:

How can I remove the white lines between the slices on a Google Pie Chart:

On the image above, I want to remove the white space highlighted by the green arrow.


回答1:


You can get rid of that gap by setting the pieSliceBorderColor to "transparent". Try the following on Google Code Playground:

function drawVisualization() {
  // Create and populate the data table.
  var data = google.visualization.arrayToDataTable([
    ['Task', 'Hours per Day'],
    ['Work', 11],
    ['Eat', 2],
    ['Commute', 2],
    ['Watch TV', 2],
    ['Sleep', 7]
  ]);

  // Create and draw the visualization.
  new google.visualization.PieChart(document.getElementById('visualization')).
    draw(data, {title:"So, how was your day?", pieSliceBorderColor:"transparent"});
}


来源:https://stackoverflow.com/questions/15410695/google-pie-chart-remove-white-gap-between-pie-slices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!