| 3284 |
vikas |
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">
|
|
|
7 |
<!--[if lte IE 8]><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 ticks on the axes, the
|
|
|
18 |
legend, the graph type, etc. The idea is that Flot goes to great
|
|
|
19 |
lengths to provide sensible defaults so that you don't have to
|
|
|
20 |
customize much for a good result.</p>
|
|
|
21 |
|
|
|
22 |
<script type="text/javascript">
|
|
|
23 |
$(function () {
|
|
|
24 |
var d1 = [];
|
|
|
25 |
for (var i = 0; i < Math.PI * 2; i += 0.25)
|
|
|
26 |
d1.push([i, Math.sin(i)]);
|
|
|
27 |
|
|
|
28 |
var d2 = [];
|
|
|
29 |
for (var i = 0; i < Math.PI * 2; i += 0.25)
|
|
|
30 |
d2.push([i, Math.cos(i)]);
|
|
|
31 |
|
|
|
32 |
var d3 = [];
|
|
|
33 |
for (var i = 0; i < Math.PI * 2; i += 0.1)
|
|
|
34 |
d3.push([i, Math.tan(i)]);
|
|
|
35 |
|
|
|
36 |
$.plot($("#placeholder"), [
|
|
|
37 |
{ label: "sin(x)", data: d1},
|
|
|
38 |
{ label: "cos(x)", data: d2},
|
|
|
39 |
{ label: "tan(x)", data: d3}
|
|
|
40 |
], {
|
|
|
41 |
series: {
|
|
|
42 |
lines: { show: true },
|
|
|
43 |
points: { show: true }
|
|
|
44 |
},
|
|
|
45 |
xaxis: {
|
|
|
46 |
ticks: [0, [Math.PI/2, "\u03c0/2"], [Math.PI, "\u03c0"], [Math.PI * 3/2, "3\u03c0/2"], [Math.PI * 2, "2\u03c0"]]
|
|
|
47 |
},
|
|
|
48 |
yaxis: {
|
|
|
49 |
ticks: 10,
|
|
|
50 |
min: -2,
|
|
|
51 |
max: 2
|
|
|
52 |
},
|
|
|
53 |
grid: {
|
|
|
54 |
backgroundColor: { colors: ["#fff", "#eee"] }
|
|
|
55 |
}
|
|
|
56 |
});
|
|
|
57 |
});
|
|
|
58 |
</script>
|
|
|
59 |
|
|
|
60 |
</body>
|
|
|
61 |
</html>
|