admin管理员组

文章数量:1279236

i am using google bar chart and in the options there is a height property. depending on my dataset i need to set a different height as things either get squeezed together or there is tons of whitespace above and below the bar chart.

is there anyway to have the chart know how much height it needs based on the number of items in the datatable?

i am using google bar chart and in the options there is a height property. depending on my dataset i need to set a different height as things either get squeezed together or there is tons of whitespace above and below the bar chart.

is there anyway to have the chart know how much height it needs based on the number of items in the datatable?

Share Improve this question edited Aug 13, 2010 at 16:10 leora asked Aug 12, 2010 at 9:58 leoraleora 197k368 gold badges906 silver badges1.4k bronze badges 1
  • 1 Can you include an example of both extremes? I believe I have a workaround but need to make sure it is applicable. – donohoe Commented Aug 18, 2010 at 18:23
Add a ment  | 

2 Answers 2

Reset to default 11 +200

Have you run into issues dynamically resizing based on dataset size?

e.g., on the Code Playground:

line 31            width:600, height: data.getNumberOfRows() * 80,

no, at least not using the bar chart API but it wouldn't be too hard for you to make a method :D

本文标签: how do i set the correct height when using javascript google bar chartStack Overflow