- <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="/site_media/js/excanvas.js"></script><![endif]-->
-
<link rel="stylesheet" type="text/css" href="/site_media/css/jquery.jqplot.css" />
-
<script language="javascript" type="text/javascript" src="/site_media/js/jquery.jqplot.js"></script>
-
<script language="javascript" type="text/javascript" src="/site_media/js/jqplot.dateAxisRenderer.min.js"></script>
-
$(document).ready(function()
-
{var line1 = $("#abcdd").html();
-
var line2 = $("#efgh").html();
-
-
var plot1 = $.jqplot('chart1', [eval(line1),eval(line2)], {
-
title:'系统调用趋势图',
-
axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer}},
-
legend: {
-
show: true
-
},
-
series:[{label: 'get'}, {label: 'commit'}]
-
});
-
});
- 相应的HTML代码如下
注意一点“:它需要的数据为Object类型的。通过eval()可以将字符串转义成相应的对象类型!