score:2

Accepted answer

There is not a built in method to dynamically increase the chart size based on the number of elements.

I handle this server side in most cases. I establish a 'base height' to account for top and bottom margins. Then I define a multiplier, set to the height needed for each element.

Then I count my data array, multiply by the multiplier, and add the base, and echo it as the height of the chart's containing div.

You could certainly handle this in javascript as easily by modifying the containing element's height after establishing the data, and before calling the chart.

Working example:


Related Articles