选项卡内 Accordian 中的 jqplot 不起作用
我正在使用 jqplot 在手风琴中显示图表。 http://www.jqplot.com/tests/UI.php
当我刚刚显示时这些图表没有被分成各种手风琴标题,它工作得很好。当我开始将图表放入各种手风琴标题中时,当我将鼠标悬停在图表应显示的位置时,我开始收到 JavaScript 错误:
Error: plot.plugins.pieRenderer is undefined
Error: plot.plugins.barRenderer is undefined
<script type="text/javascript">
$(function() {
$("#RTD_BreakGroups").accordion({
autoHeight: false,
navigation: true,
collapsible: true,
active: false
});
$("#RTD_BreakGroups").bind('accordionchange', function(event, ui) {
var index = $(this).find("h3").index(ui.newHeader[0]);
switch (index)
{
case 1:
goodbadplot.replot();
percentdiffplot.replot();
break;
case 10:
Engineergoodplot.replot();
Engineerbadplot.replot();
break;
}
});
});
<div id="RTD_BreakGroups">
<h3><a href="#">RTD Overview</a></h3>
<div>
<div id="GoodVsBad" data-height="450" data-width="450" style="height:450px;width:450px;"></div>
<div id="GoodVsBadThreshold" data-height="250" data-width="700" style="height:250px;width:700px;"></div>
<style type="text/css">
#GoodVsBadThreshold .jqplot-meterGauge-tick, #GoodVsBadThreshold .jqplot-meterGauge-label
{
font-size: 10pt;
}
</style>
</div>
<h3><a href="#">Engineer Overview</a></h3>
<div>
This grouping shows how RTD has been behaving if the player is a engineer.
<div id="EngineerGoodRolls" data-height="450" data-width="1024" style="height:450px;width:1024px;"></div>
<div id="EngineerBadRolls" data-height="450" data-width="1024" style="height:450px;width:1024px;"></div>
</div>
</div>
就像我上面所说,这些图表不在手风琴中时加载正常,但会抛出有关未定义的错误在手风琴中时的渲染器。任何人都可以看到我做错了什么吗?
I am using jqplot to show graphs in an accordion. http://www.jqplot.com/tests/UI.php
When I just show the graphs without them being split into various accordion headers it works perfectly. As soon as I started putting the charts into the various accordion headers I started getting javascript errors when I mouse over where the chart should appear:
Error: plot.plugins.pieRenderer is undefined
Error: plot.plugins.barRenderer is undefined
<script type="text/javascript">
$(function() {
$("#RTD_BreakGroups").accordion({
autoHeight: false,
navigation: true,
collapsible: true,
active: false
});
$("#RTD_BreakGroups").bind('accordionchange', function(event, ui) {
var index = $(this).find("h3").index(ui.newHeader[0]);
switch (index)
{
case 1:
goodbadplot.replot();
percentdiffplot.replot();
break;
case 10:
Engineergoodplot.replot();
Engineerbadplot.replot();
break;
}
});
});
<div id="RTD_BreakGroups">
<h3><a href="#">RTD Overview</a></h3>
<div>
<div id="GoodVsBad" data-height="450" data-width="450" style="height:450px;width:450px;"></div>
<div id="GoodVsBadThreshold" data-height="250" data-width="700" style="height:250px;width:700px;"></div>
<style type="text/css">
#GoodVsBadThreshold .jqplot-meterGauge-tick, #GoodVsBadThreshold .jqplot-meterGauge-label
{
font-size: 10pt;
}
</style>
</div>
<h3><a href="#">Engineer Overview</a></h3>
<div>
This grouping shows how RTD has been behaving if the player is a engineer.
<div id="EngineerGoodRolls" data-height="450" data-width="1024" style="height:450px;width:1024px;"></div>
<div id="EngineerBadRolls" data-height="450" data-width="1024" style="height:450px;width:1024px;"></div>
</div>
</div>
Like I said above, these charts load fine when they are not in the accordion, but throw errors about undefined renderers when in the accordion. Can any one see what I've done wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该错误与尝试绘制隐藏 div
https://bitbucket 有关.org/cleonello/jqplot/issue/252/ppluginsbarrenderer-is-undefined
the error is related to attempting to plot into a hidden div
https://bitbucket.org/cleonello/jqplot/issue/252/ppluginsbarrenderer-is-undefined
这修复了手风琴
或选项卡的问题
this fixes it for accordion
or this for tabs