0
A
回答
2
下面是5個使用時間作爲X軸的5種不同顏色的圖形的示例。點擊鏈接可更新數據系列和圖表。
<script language="javascript" type="text/javascript" src="../jquery.js"></script>
<script language="javascript" type="text/javascript" src="../jquery.flot.js"></script>
<div id="graph_1" style="width:300px;height:100px;"></div>
<div id="graph_2" style="width:300px;height:100px;"></div>
<div id="graph_3" style="width:300px;height:100px;"></div>
<div id="graph_4" style="width:300px;height:100px;"></div>
<div id="graph_5" style="width:300px;height:100px;"></div>
<script>
// Initialize the data to be graphed
var data = new Array();
data[0] = new Array();
data[1] = new Array();
data[2] = new Array();
data[3] = new Array();
data[4] = new Array();
var ticks = new Array();
draw_graphs();
// Draw the graphs
function draw_graphs() {
$.plot($("#graph_1"), [{data:data[0],color:1}],{ xaxis: { mode: "time" }});
$.plot($("#graph_2"), [{data:data[1],color:2}],{ xaxis: { mode: "time" }});
$.plot($("#graph_3"), [{data:data[2],color:3}],{ xaxis: { mode: "time" }});
$.plot($("#graph_4"), [{data:data[3],color:4}],{ xaxis: { mode: "time" }});
$.plot($("#graph_5"), [{data:data[4],color:5}],{ xaxis: { mode: "time" }});
}
// Update the data
function change_data(n) {
d = new Date();
data[n].push([d.getTime(),n]);
draw_graphs();
}
</script>
<a href="#" onclick="change_data(0)">Update 1</a><br>
<a href="#" onclick="change_data(1)">Update 2</a><br>
<a href="#" onclick="change_data(2)">Update 3</a><br>
<a href="#" onclick="change_data(3)">Update 4</a><br>
<a href="#" onclick="change_data(4)">Update 5</a><br>
的海軍報示例頁面
相關問題
- 1. 如何動態創建Flot JS的數據集?
- 2. 如何動態創建數據列表
- 3. 在圖表中動態創建系列
- 4. 多系列,多Yaxis動態flot
- 5. 如何在Oracle-APEX中創建動態多系列折線圖?
- 6. 動態創建Asp系列圖表多系列
- 7. 如何爲Handsontable創建動態列?
- 8. 爲未知列數動態創建列
- 9. 根據數據動態創建視圖
- 10. 如何爲UITableViewCell動態創建圖像
- 11. 如何創建動態數據庫?
- 12. 如何創建數據模型動態
- 13. MVC如何創建動態數據表?
- 14. 創建動態列和數據綁定
- 15. 谷歌圖表:創建動態數據視圖列
- 16. 創建動態數據
- 17. 動態創建數據庫
- 18. Primefaces 5.0圖表 - 如何從數據庫中動態創建完全圖表模型和一系列值
- 19. 如何使用動態數據創建AngularJS圖表
- 20. 如何動態創建動態庫中的mysql數據庫
- 21. 如何爲動態數據表創建xpath?
- 22. 動態創建一列數據表作爲超鏈接
- 23. 使用一個數據點在Flot中創建步驟圖表
- 24. 如何爲靜態和動態頁面創建站點地圖
- 25. FLOT數據作爲圖像寫入PDF
- 26. 如何在tablelayout中動態創建列?
- 27. 如何動態創建列表框wpf
- 28. 如何在android中動態創建列?
- 29. 如何在asp:gridview中動態創建列
- 30. 如何使用TableLayoutPanel創建動態列?