我正在尝试在jQuery Mobile项目中显示一个生成的flot图表。
如果我通过其绝对路径调用jQuery Mobile页面(类似于: http://server.com/graph/fancy.php),一切都运行正常,但是一旦我开始使用jQM集成的AJAX导航,图表就会看起来混乱不堪。
我还发现了这个主题:jquery mobile and flot library,但其中描述的解决方案都不适用于我。
有没有办法让jQM和flot一起工作?不幸的是,禁用AJAX也不是一个选项。
图表生成:
我还发现了这个主题:jquery mobile and flot library,但其中描述的解决方案都不适用于我。
有没有办法让jQM和flot一起工作?不幸的是,禁用AJAX也不是一个选项。
图表生成:
<script type="text/javascript">
var data = [[0, 3], [4, 8], [8, 5], [9, 13]];
$(function () {
var plot = $.plot($("#chart"), [
{
label: "Oh hai",
data: data,
bars: { show: true }
}
]);
});
</script>
<div id="chart" style="width: 600px; height: 350px;"></div>