简体   繁体   中英

Google Pie chart: remove white gap between pie slices

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.

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"});
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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