繁体   English   中英

对话框中的jquery flot图

[英]jquery flot graph in dialog

问题:在对话框中显示jquery flot图

我有一个页面,使用flot显示水平条形图,这是交互式的。 当我点击任何一个条形时,它执行getJSON并传递变量,在外部php页面中绘制另一个图形。 我正在尝试在jquery对话框中显示的外部php页面中绘制图形。

我一直在寻找,但我无法找到解决方案。 任何帮助表示赞赏。

    $.getJSON("page2.php?"+data, function(mdata) {
        $('<div></div>').html(result).dialog({ 
        autoOpen: false, 
        modal: true, 
        title: 'Page Hits - Monthly', 
        width: 450, height: 300 
    }).dialog('open'); 

第2页是绘制图形的位置,我想在对话框内的当前页面中显示图形。

也许尝试$.get而不是$.getJSON

$.get('page2.php?'+data, function(response){
  $('<div></div>').html(response).dialog({ 
    autoOpen: true, 
    modal: true, 
    title: 'Page Hits - Monthly', 
    width: 450, height: 300 
  });
}); 

您可以创建一个PHP类来包含您的数据,将您的图形数据存储在类的实例中,然后将该对象作为发布数据传递到对话框或弹出窗口。

然后可以创建一个方法来处理自定义数据并相应地绘制图形。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM