Google Chart Chart Chart Chart Options Are Not Affected

I play with the google API.

Everything works fine, except for the stroke options: and strokeWidth :. Regardless of the fact that I installed them, nothing changes.

I have a dark background color, and the lines between the slices are white. I am trying to change them to the same color as the background. I also cannot change the width of these lines.

Here is my code:

<script src="https://www.google.com/jsapi"></script> <script> google.load("visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Task'); data.addColumn('number', 'Hours per Day'); data.addRows(5); data.setValue(0, 0, 'Work'); data.setValue(0, 1, 11); data.setValue(1, 0, 'Eat'); data.setValue(1, 1, 2); data.setValue(2, 0, 'Commute'); data.setValue(2, 1, 2); data.setValue(3, 0, 'Watch TV'); data.setValue(3, 1, 2); data.setValue(4, 0, 'Sleep'); data.setValue(4, 1, 7); // Create and draw the visualization. new google.visualization.PieChart(document.getElementById('poll-chart')). draw(data, { title:"", fontSize: "12", legend: "none", width: 200, height: 200, chartArea: { left: 0, top: 0, width: "100%", height: "100%"}, backgroundColor: { stroke: "#5A5A5A", strokeWidth: 5, fill: "#5A5A5A" } }); } </script> 

I am referring to the Google API from the options on this page:

http://code.google.com/apis/chart/interactive/docs/gallery/piechart.html#Configuration_Options

I am not sure if I am doing something wrong or not.

Your help or guidance will be greatly appreciated!

Thanks Michael.

EDIT:

So, it seems that the properties that I messed with are related to the outer stroke of the whole diagram, and not for each fragment. I'm still stuck. Does anyone know how I can close the white spaces between slices? I can’t find anything on Google about this.

+7
source share
1 answer

Use pieSliceBorderColor . It may have been added after this question was asked, but for any future reference, this is how you do it. Note: this will only work on a two-dimensional pie chart

 new google.visualization.PieChart(document.getElementById('poll-chart')). draw(data, { title:"", fontSize: "12", legend: "none", width: 200, height: 200, chartArea: { left: 0, top: 0, width: "100%", height: "100%"}, backgroundColor: { stroke: "#5A5A5A", strokeWidth: 5, fill: "#5A5A5A" }, // add this line pieSliceBorderColor : "#5A5A5A" }); 
+10
source

All Articles