The gvisPieChart()
function does not create an image, so fig.align
will not work. You need to add code to center the javascript.
The easiest way to do this is:
cat("<center>")
print(doughnut, "chart")
cat("</center>")
Using <center>
is not very good coding (in the HTML world), but it is quick and should work for what you are trying to do.
EDIT (tyler rinker)
For me this worked.
I added:
img.center {
display: block;
margin-left: auto;
margin-right: auto;
}
To my style.css and then wrapped the code chunk with <img class="center"></img>