Highcharts: How to adjust size of bar chart with respect to spacing/size of bars? -


i have bar graph (note: length of bar spans horizontally. conversely, column graph spans vertically. see below.) series data can either become long list or short list number of bars varies between many , few. if have many bars, graph needs more height maintain same space between bars , maintain width of bars. how can set height of graph ensure these fixed?

i looked scrollbar vertical axis, didn't because browser may have it's own vertical scrollbar. found advice on dynamically resizing graph fit window, won't work if have more bars fit within maximized window. think best idea have graph sizes number of bars. if bar graph greater page height, browser's vertical scrollbar come action.

bar graph:

=== ========== =============== ]---- width of bars needs maintained.  [spacing between bars needs maintained.] ======= =========== === <--- new bar go here, , chart increase height 1 bar width.  

the best solution have found determine size simple count of categories need on server side.

when loading page, start height needed chart's top , bottom margin. count of data, , multiply space need (usually 20, 25 pixels per category, in cases).

then set height of container accordingly.

i php on page load. i'm sure javascript implementation wouldn't difficult achieve.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -