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?
One very common option to set is the chart height and width. You can specify the chart size in two places: in the HTML of the container <div> element, or in the chart options. If you specify the size in both locations, the chart will generally defer to the size specified in the HTML.
Customize a bar chartChoose an option: Chart style: Change how the chart looks. Chart & axis titles: Edit or format title text. Series: Change bar colors, axis location, or add error bars, data labels, or trendline.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With