This has plagued me for a week, so I had to come to SO. (Forgive the URL, it\'s a dev server). http://www.stagestudio.com.ua/shutter_stat/wiev_base.php?cat=34
when I
This is a known issue that comes up from time to time. If a <div>
is invisible, then it doesn't have any well-defined height or width. So rendering a chart in it doesn't do anything useful (it has zero height). dygraphs has no way of knowing that the chart <div>
has become visible. This is really a gap in the DOM Events API. Other libraries like Google Maps have similar issues.
Workarounds are:
.resize()
without any parameters to force a redraw when the popup appears.<div>
will have a size when the chart is rendered.<div>
. // These will be zero if the dygraph's div is hidden. In that case,
// use the user-specified attributes if present. If not, use zero
// and assume the user will call resize to fix things later.
this.width_ = div.clientWidth || attrs.width || 440;
this.height_ = div.clientHeight || attrs.height ||320;