ast*_*_jv 15 css jquery charts flot twitter-bootstrap
当我在隐藏的标签中插入图表时,如第二,第三等,我有这个错误.这里是错误:
Invalid dimensions for plot, width = 0, height = 400 in js/jquery.flot.min.js:6.
Run Code Online (Sandbox Code Playgroud)
我使用了bootstrap 2和jquery:
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
这是图书馆:
<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>
Run Code Online (Sandbox Code Playgroud)
和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;
}
Run Code Online (Sandbox Code Playgroud)
带有每个图表id的div(总是将id更改为我需要显示的图表,如plotarea,pie,barmonth,baryear等):
<div id="plotarea"></div>
Run Code Online (Sandbox Code Playgroud)
我添加这种样式来修复宽度错误.ui-tabs .ui-tabs-hide { left: -10000px; visibility: hidden !important; }
,但即使这样,图表也不会在那些隐藏标签内绘制图表,只绘制第一个视图中的第一个标签...如果有一个表单,你现在可以吗?修理它?
我使用魅力模板.
最好的祝福!
ast*_*_jv 30
好吧,我已经做到了!
如果你有这个库<script src="js/jquery.flot.resize.min.js"></script>
,你只需要在styles.css(样式表文件)中更改它:
max-width: none;
height: 400px;
Run Code Online (Sandbox Code Playgroud)
有了这个:
width: 100%;
height: 400px;
Run Code Online (Sandbox Code Playgroud)
现在,图表总是在每个屏幕中调整大小.
my *_*ram 13
我遇到过同样的问题.一个不同的解决方案对我有用.