Google Visualization Pie Chart text anchor issue

2019-04-17 04:08发布

问题:

I am drawing google pie chart but values cut off. Any suggestion what is going on? Any help will be appreciated.

回答1:

You are drawing the charts inside a hidden div (div id "control_search_results" has "disply:none" via class "hidden"). This messes up the dimension detection algorithms in the API, which is why your labels are off. You need to unhide the div prior to drawing the charts.

Be aware that this will fix the problem in most browsers, but you could still run into a similar issue in Chrome due to the browser bug I mentioned in the comments above.