Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/382.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript AngularJS ui图表在ui引导选项卡中不工作_Javascript_Angularjs_Jqplot - Fatal编程技术网

Javascript AngularJS ui图表在ui引导选项卡中不工作

Javascript AngularJS ui图表在ui引导选项卡中不工作,javascript,angularjs,jqplot,Javascript,Angularjs,Jqplot,我使用angularjs模块来显示一个折线图,问题是当我把它放在选项卡中时,它只在第一个选项卡上显示折线图,而不会在第二个或第三个选项卡上显示 当我阅读(ui图表是jqPlot的一个指令)时,它说需要使用replot(),但我不知道如何在ui图表中实现这一点 有人能给我一个提示吗?我通过修改ui图表指令,在其末尾添加以下内容,成功地做到了这一点: var plot = $.jqplot(elem.attr('id'), data, opts); // search for a tabpanel

我使用angularjs模块来显示一个折线图,问题是当我把它放在选项卡中时,它只在第一个选项卡上显示折线图,而不会在第二个或第三个选项卡上显示

当我阅读(ui图表是jqPlot的一个指令)时,它说需要使用replot(),但我不知道如何在ui图表中实现这一点


有人能给我一个提示吗?

我通过修改ui图表指令,在其末尾添加以下内容,成功地做到了这一点:

var plot = $.jqplot(elem.attr('id'), data, opts);

// search for a tabpanel (jquery-ui tabs) containing the chart
elem.closest('.tabpanel').bind('tabsactivate',
    function(event, ui) {
        if (plot._drawCount === 0) {
            plot.replot();
        }
});

if\u drawCount部分非常重要,因为复制图表是一项繁重的操作。

我通过修改ui chart指令,在其末尾添加以下内容来实现这一点:

var plot = $.jqplot(elem.attr('id'), data, opts);

// search for a tabpanel (jquery-ui tabs) containing the chart
elem.closest('.tabpanel').bind('tabsactivate',
    function(event, ui) {
        if (plot._drawCount === 0) {
            plot.replot();
        }
});

if\u drawCount部分非常重要,因为复制图表是一项繁重的操作。

您是否包含了所需的所有插件?您需要为每个图形包含适当的插件。我忘了很多次了。否则,我认为我们可能需要代码来做更多的调查。例如,要绘制饼图,必须包括:

<script src=".../jqplot/plugins/jqplot.pieRenderer.js" type="text/javascript"></script>


另外。

您是否包括了所有需要的插件?您需要为每个图形包含适当的插件。我忘了很多次了。否则,我认为我们可能需要代码来做更多的调查。例如,要绘制饼图,必须包括:

<script src=".../jqplot/plugins/jqplot.pieRenderer.js" type="text/javascript"></script>

另外