root / hci / trunk / eneraptor-web-app / web-app / js / flot / examples / setting-options.html @ 11
History | View | Annotate | Download (2.14 KB)
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
---|---|
2 |
<html>
|
3 |
<head>
|
4 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
5 |
<title>Flot Examples</title> |
6 |
<link href="layout.css" rel="stylesheet" type="text/css"></link> |
7 |
<!--[if IE]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]-->
|
8 |
<script language="javascript" type="text/javascript" src="../jquery.js"></script> |
9 |
<script language="javascript" type="text/javascript" src="../jquery.flot.js"></script> |
10 |
</head>
|
11 |
<body>
|
12 |
<h1>Flot Examples</h1> |
13 |
|
14 |
<div id="placeholder" style="width:600px;height:300px"></div> |
15 |
|
16 |
<p>There are plenty of options you can set to control the precise
|
17 |
looks of your plot. You can control the axes, the legend, the |
18 |
default graph type, the look of grid, etc.</p>
|
19 |
|
20 |
<p>The idea is that Flot goes to great lengths to provide <b>sensible |
21 |
defaults</b> which you can then customize as needed for your
|
22 |
particular application. If you've found a use case where the |
23 |
defaults can be improved, please don't hesitate to give your |
24 |
feedback.</p>
|
25 |
|
26 |
<script id="source" language="javascript" type="text/javascript"> |
27 |
$(function () {
|
28 |
var d1 = [];
|
29 |
for (var i = 0; i < Math.PI * 2; i += 0.25)
|
30 |
d1.push([i, Math.sin(i)]);
|
31 |
|
32 |
var d2 = [];
|
33 |
for (var i = 0; i < Math.PI * 2; i += 0.25)
|
34 |
d2.push([i, Math.cos(i)]);
|
35 |
|
36 |
var d3 = [];
|
37 |
for (var i = 0; i < Math.PI * 2; i += 0.1)
|
38 |
d3.push([i, Math.tan(i)]);
|
39 |
|
40 |
$.plot($("#placeholder"), [
|
41 |
{ label: "sin(x)", data: d1},
|
42 |
{ label: "cos(x)", data: d2},
|
43 |
{ label: "tan(x)", data: d3}
|
44 |
], {
|
45 |
series: {
|
46 |
lines: { show: true },
|
47 |
points: { show: true }
|
48 |
},
|
49 |
xaxis: {
|
50 |
ticks: [0, [Math.PI/2, "\u03c0/2"], [Math.PI, "\u03c0"], [Math.PI * 3/2, "3\u03c0/2"], [Math.PI * 2, "2\u03c0"]]
|
51 |
},
|
52 |
yaxis: {
|
53 |
ticks: 10,
|
54 |
min: -2,
|
55 |
max: 2
|
56 |
},
|
57 |
grid: {
|
58 |
backgroundColor: { colors: ["#fff", "#eee"] }
|
59 |
}
|
60 |
});
|
61 |
});
|
62 |
</script>
|
63 |
|
64 |
</body>
|
65 |
</html>
|