浮点图API的未捕获尺寸无效,宽度= null,高度= null [英] Uncaught Invalid dimensions for plot, width = null, height = null for flot charts api

查看:90
本文介绍了浮点图API的未捕获尺寸无效,宽度= null,高度= null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用浮点图API来显示图形,并且可以成功绘制数据. 我在一页中加载约30张图表,并在ui-tabs中呈现它们.所有图形均呈现完美,页面运行正常,但仍然出现此错误. 我对所有图表使用了不同的div ID,所有的div都指定了高度和宽度.自昨天以来,我找不到解决方案,我已将flot所需的所有js都包含在中央页面中. 请在这方面帮助我.

I am using flot charts API for showing the graphs and I am successful in plotting the data. I am loading around 30 charts in one page and I am rendering them in ui-tabs.All the graphs are rendered perfectly and page is working fine.But still I am getting this error. I have used different div ids to all the graphs,height and width is given to all the divs. I am not able to find the solution since yesterday.I have included all the js required for the flot in the central page. Please help me in this regard.

推荐答案

非活动选项卡中的div元素不可见,在显示之前没有宽度或高度.这可能会导致浮动问题,此处的默认做法是仅在显示选项卡时才渲染图形.

The div elements in inactive tabs are invisible and have no width or height until they are shown. This can cause problems with flot and the default practise here would be to render the graphs only when the tabs are shown.

一种选择是将div绝对值放置在页面之外,渲染绘图图,然后将div移到选项卡中.

One alternative would be to position the divs absolute out of the page, render the plot graphs and then move the divs into the tabs.

这篇关于浮点图API的未捕获尺寸无效,宽度= null,高度= null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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