This sounds like the same kind of problem where axis labels are overwriting each other in some cases. All these problems are probably due to the same side effect of a recent change to avoid a memory leak. Because gviz is estimating the size of things as they are rendered, they need to be rendered visibly or it will assume they have size 0, so it is now generally required to do the rendering when the chart and all containers do not have * display:none*. Here are several possibilities:
- Generally, you need to expose the chart, render it, and then hide it again. - Use visibility:hidden, because the rendering does take up space; you just can't see it. - Use position:absolute to move the container off screen, render the chart, then hide the container again with display:none, and remove the position:absolute. This is especially useful if your chart takes longer to render and you want to avoid the flashing. - Use a timeout if necessary to wait until the containers are all visible in the document. Especially relevant when using AJAX, as Jorge suggests. dan On Wed, Sep 26, 2012 at 4:24 AM, Jorge Casas <[email protected]> wrote: > Not only unhide the div. I was loading a chart using AJAX into a DIV, and > it worked... but suddenly it begun to fail. I think it is due the > browsers... > > My solution was using a setTimeout with 100 msecs of timeout... and it > works again... but it is weird anyway... > > On Wednesday, October 19, 2011 6:49:07 PM UTC+2, asgallant wrote: >> >> There are a number of errors that crop up when drawing the chart in a >> hidden div. I'm not sure whether they are Google's fault or an issue with >> the way browsers render SVG. The end route around the problem is to unhide >> the div just prior to drawing, and hook the chart's ready event to hide the >> div when it has finished. In practice, the drawing time for charts is so >> quick that this is completely transparent to the user. > > -- > You received this message because you are subscribed to the Google Groups > "Google Visualization API" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/google-visualization-api/-/d_99p5Pmil8J. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-visualization-api?hl=en. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> - 978-394-1058 [email protected] <[email protected]> 562D 5CC, Cambridge MA [email protected] <[email protected]> 9 Juniper Ridge Road, Acton MA -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
