javascript - Google Pie Chart does not fit the container - Stack Overflow

I am working with Google Chart API and have developed a pie chart with reference to Visualization: Pie

I am working with Google Chart API and have developed a pie chart with reference to Visualization: Pie Chart

Screenshot of my pie chart:-

Screenshot shows the container via firebug...

Here is the problem arises, the low opacity blue color is the container(i.e. div) in which the chart is appearing, some what it doesn't fit to that outer div in which its contained and showing some useless whitespaces, the pie chart should fit the div anyhow if my code is right...

Working on this code:-

var options_pie = {
chartArea: { left: 0, top: 0, width: "100%", height: "60%"},
colors: ['#59ea54', '#a14660', '#f3cf4a', '#16a2c2', '#ce7374', '#39ae9b'],
legend: 'none',
};

var chartPie = new google.visualization.PieChart(document.getElementById('chart_pie'));
chartPie.draw(data, options_pie);

I dont know, am i missing something or its the problem with the api?

I am working with Google Chart API and have developed a pie chart with reference to Visualization: Pie Chart

Screenshot of my pie chart:-

Screenshot shows the container via firebug...

Here is the problem arises, the low opacity blue color is the container(i.e. div) in which the chart is appearing, some what it doesn't fit to that outer div in which its contained and showing some useless whitespaces, the pie chart should fit the div anyhow if my code is right...

Working on this code:-

var options_pie = {
chartArea: { left: 0, top: 0, width: "100%", height: "60%"},
colors: ['#59ea54', '#a14660', '#f3cf4a', '#16a2c2', '#ce7374', '#39ae9b'],
legend: 'none',
};

var chartPie = new google.visualization.PieChart(document.getElementById('chart_pie'));
chartPie.draw(data, options_pie);

I dont know, am i missing something or its the problem with the api?

Share Improve this question asked Jun 7, 2013 at 12:03 SaurabhLPSaurabhLP 3,6559 gold badges41 silver badges71 bronze badges 2
  • Is it any different without the left: 0, and top: 0;? – GusRuss89 Commented Jun 7, 2013 at 12:21
  • @GusRuss89 Thanks for reply, that also tried, but no effect... – SaurabhLP Commented Jun 7, 2013 at 12:50
Add a ment  | 

1 Answer 1

Reset to default 6

Try to modify width and height, for example :

 options.chartArea = {left:0, 'width': '80%', 'height': '80%'}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744703431a4588910.html

相关推荐

  • javascript - Google Pie Chart does not fit the container - Stack Overflow

    I am working with Google Chart API and have developed a pie chart with reference to Visualization: Pie

    1天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信