javascript - ECharts automatic height -


is possible create echarts line chart without specifying it's container height - make responsive actual data.

the number of items in y axis can vary.

by default, when don't define height of container, 0 , chart not visible.


in example there 6 items (months) in y axis, if wanted show 12 months in same container, without making bars 50% narrower? enter image description here

if know how many rows or bars going have, can use calculate height of container.

for example, if each row 31px , fixed height of graph header & footer 200px use:

var chartheight = datavalues.length * 31 + 200; $('#graph-container').css({'height': chartheight}); 

Comments

Popular posts from this blog

How to get the arclen between two curve points in Maya? -

C++ Linked List -

git svn - Unignore directories in git-svn (adding directories to a sparse checkout) -