I know this is old, but I had a situation where I was creating a pie chart and I needed to change the background color behind the pie chart. I tried this solution, but it did not work because I did not assign a topic. I create it as follows:
var pieChart = new Chart("myDIV"); pieChart.addPlot("default", {type: "Pie"}); pieChart.addSeries("Series A", pieString);
My pieString is where I combine my variables together to form a pie. In principle, I combine a number of such statements:
{y:200, tooltip: "layer", color:"red", text: "myText"}
I concatenate these lines together and assign them to the pieString variable.
When I set up my schedule, I had a standard white background that does not work well for my color background, since I wanted it to blend. There are two rectangles that make up the background. You can change the back and the back to pieChart.fill = "something" , but the inside has not changed.
How I decided it for me, like this.
function ClearChartBackground() { var sumDivRects = document.getElementById("chartDIV").getElementsByTagName("svg")[0].getElementsByTagName("rect");
As you can see in my photo, the original background was white, which does not work well on my gray background. After performing my function, it will be changed to transparent.
I am posting this because it took me quite a while to learn how to change this since I have a Dojo for it. I came across this message, but I did not get much help from it, because I did not do the topic.
