在打开浏览器检查窗口或调整浏览器大小之前,dygraphs div不可见 [英] dygraphs div not visible until browser Inspection window opened or browser resize

查看:124
本文介绍了在打开浏览器检查窗口或调整浏览器大小之前,dygraphs div不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这困扰了我一个星期,所以我不得不来. (请原谅URL,这是一个开发服务器). http://www.stagestudio.com.ua/shutter_stat/wiev_base.php ?cat = 34

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 click on the photo the popup with linechart should appear but in fact the linechart is non visible. It can be visible only after resize the window or open browser inspection window.

我该如何解决?

此方法无效<script> var graph = new Dygraph(document.getElementById("graphPanel"), "temperatures.csv", { animatedZooms: true }); $(document).ready(function () { graph.resize(800, 500) }); </scrip>

This method dont work <script> var graph = new Dygraph(document.getElementById("graphPanel"), "temperatures.csv", { animatedZooms: true }); $(document).ready(function () { graph.resize(800, 500) }); </scrip>

推荐答案

 // 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;

这篇关于在打开浏览器检查窗口或调整浏览器大小之前,dygraphs div不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆