| 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 |
<script language="javascript" type="text/javascript" src="../jquery.flot.symbol.js"></script>
|
|
|
11 |
</head>
|
|
|
12 |
<body>
|
|
|
13 |
<h1>Flot Examples</h1>
|
|
|
14 |
|
|
|
15 |
<div id="placeholder" style="width:600px;height:300px"></div>
|
|
|
16 |
|
|
|
17 |
<p>Various point types. Circles are built-in. For other
|
|
|
18 |
point types, you can define a little callback function to draw the
|
|
|
19 |
symbol; some common ones are available in the symbol plugin.</p>
|
|
|
20 |
|
|
|
21 |
<script type="text/javascript">
|
|
|
22 |
$(function () {
|
|
|
23 |
function generate(offset, amplitude) {
|
|
|
24 |
var res = [];
|
|
|
25 |
var start = 0, end = 10;
|
|
|
26 |
for (var i = 0; i <= 50; ++i) {
|
|
|
27 |
var x = start + i / 50 * (end - start);
|
|
|
28 |
res.push([x, amplitude * Math.sin(x + offset)]);
|
|
|
29 |
}
|
|
|
30 |
return res;
|
|
|
31 |
}
|
|
|
32 |
|
|
|
33 |
var data = [
|
|
|
34 |
{ data: generate(2, 1.8), points: { symbol: "circle" } },
|
|
|
35 |
{ data: generate(3, 1.5), points: { symbol: "square" } },
|
|
|
36 |
{ data: generate(4, 0.9), points: { symbol: "diamond" } },
|
|
|
37 |
{ data: generate(6, 1.4), points: { symbol: "triangle" } },
|
|
|
38 |
{ data: generate(7, 1.1), points: { symbol: "cross" } }
|
|
|
39 |
];
|
|
|
40 |
|
|
|
41 |
$.plot($("#placeholder"), data, {
|
|
|
42 |
series: { points: { show: true, radius: 3 } },
|
|
|
43 |
grid: { hoverable: true }
|
|
|
44 |
});
|
|
|
45 |
});
|
|
|
46 |
</script>
|
|
|
47 |
|
|
|
48 |
</body>
|
|
|
49 |
</html>
|