javascript - Resizable Google Visualization inside JQuery Accordion -
inside of jquery resizable div
have jquery accordion widget. inside of each accordion element table
centered in accordion div
setting width: 100%; margin: 0 auto;
. in each table td
element has google visualization column chart.
when resize event triggered i'd google visualizations redraw dimensions of charts fit new container sizes. problem i'm having chart redrawn proper dimensions 1 in visible accordion div.
i'm assuming when div
element set display=none
container dimensions ignored in resize event. if true have suggestions work around this?
i should add width of visualization set '100%' not pixel number.
thanks
you may need set explicity dimensions in in chart.draw() call since you're drawing chart on hidden element. options variable set to:
var options = {'width':400, 'height':300}; //substitute desired dimensions chart.draw(data, options);
adjust accordingly if you're using 1 of other google charts draw methods (wrapper.draw() or drawchart()).
from recent similar question, google charts api pulls dimensions container element when draw call made, if container hidden, has nothing pull from.
Comments
Post a Comment