隐藏标签中的绘图,宽度= 0,高度= 400的尺寸无效 [英] Invalid dimensions for plot, width = 0, height = 400 inside of hidden tab

查看:3320
本文介绍了隐藏标签中的绘图,宽度= 0,高度= 400的尺寸无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在第二,第三等隐藏标签中插入图表时出现此错误。
此处是错误:

 在js / jquery.flot.min.js中,plot,width = 0,height = 400的维度无效:6。 

我使用bootstrap 2和jquery:

 < script type =text / javascriptsrc =js / jquery-1.7.2.min.js>< / script& 

以下是库:

 < script src =js / jquery.flot.min.js>< / script> 
< script src =js / jquery.flot.pie.min.js>< / script>
< script src =js / jquery.flot.stack.js>< / script>
< script src =js / jquery.flot.resize.min.js>< / script>

而css:

  #plotarea 
{
max-width:none;
height:400px;
}
#pie
{
max-width:none;
height:400px;
}
#barmonth
{
max-width:none;
height:400px;
}
#baryear
{
max-width:none;
height:400px;
}

具有每个图表的id的div(始终将id更改为图表我需要显示,像plotarea,饼,barmonth,baryear等):

 < div id =plotarea ;< / div> 

我添加这种风格来修复宽度错误 .ui-tabs。 ui-tabs-hide {left:-10000px; visibility:hidden!important; } ,但即使这个图表不绘制这些隐藏的选项卡的图表只绘制第一个选项卡是在第一个视图...现在如果有一个表单来修复它?



我使用charisma模板。





如果你有这个库< script src =js / jquery.flot.resize.min.js>< / script> ,你只需要在styles.c文件中修改这个内容:

  max-width:none; 
height:400px;

  width:100%; 
height:400px;

现在图表总是在每个屏幕上调整大小。


I have this error when I insert charts in hidden tabs like second, third, etc. here is the error:

Invalid dimensions for plot, width = 0, height = 400 in js/jquery.flot.min.js:6.

I used bootstrap 2 and jquery:

<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>

Here are the libraries:

<script src="js/jquery.flot.min.js"></script>
<script src="js/jquery.flot.pie.min.js"></script>
<script src="js/jquery.flot.stack.js"></script>
<script src="js/jquery.flot.resize.min.js"></script>

And the css:

#plotarea
{
    max-width: none;
    height: 400px;
}
#pie 
{
    max-width: none;
    height: 400px;
}
#barmonth 
{
    max-width: none;
    height: 400px;
}
#baryear 
{
    max-width: none;
    height: 400px;
}

The div with the id of every chart(always change the id to the chart I need to show, like plotarea, pie, barmonth, baryear, etc):

<div id="plotarea"></div>

And I add this style to fix the width error .ui-tabs .ui-tabs-hide { left: -10000px; visibility: hidden !important; }, but even this the chart doesn't draw the charts inside of those hidden tabs only draw the first tab which is in the first view...can you now if there is a form to fix it?

I use the charisma template.

Best regards!

解决方案

Well I already made it!

If you have this library <script src="js/jquery.flot.resize.min.js"></script>, you only need to change this inside of styles.css(the stylesheets file):

max-width: none;
height: 400px;

with this:

width: 100%;
height: 400px;

Now the charts always resize in every screen.

这篇关于隐藏标签中的绘图,宽度= 0,高度= 400的尺寸无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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