forked from entropillc/flot.touch
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.html
61 lines (60 loc) · 2.52 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<title>Flot Examples</title>
<link rel="stylesheet" media="screen" href="css/jquery.mobile-1.0b2.css"/>
<!--[if lte IE 8]><script type="text/javascript" src="lib/excanvas.js"></script><![endif]-->
<script type="text/javascript" src="lib/jquery-1.6.2.js"></script>
<script type="text/javascript" src="jquery.flot.js"></script>
<script type="text/javascript" src="jquery.flot.touch.js"></script>
<script type="text/javascript" src="lib/jquery.mobile-1.0b2.js"></script>
<script type="text/javascript">
$(function() {
var sin = [];
for (var i = -20; i <= 20; i += 0.5) {
sin.push([i, Math.sin(i)]);
}
$.plot($('#placeholder'), [{
data: sin,
label: 'sin(x)'
}], {
series: {
lines: { show: true },
points: { show: true }
},
touch: {
pan: 'x',
scale: 'x'
}
});
});
</script>
</head>
<body>
<div id="flot" data-role="page">
<div data-role="header">
<a href="#about" data-icon="info">About</a>
<h1>Flot Touch</h1>
</div>
<div data-role="content">
<div id="placeholder"></div>
</div>
</div>
<div id="about" data-role="page">
<div data-role="header">
<a href="#" data-icon="arrow-l" data-rel="back">Back</a>
<h1>About Flot Touch</h1>
</div>
<div data-role="content">
<p>The <a href="https://github.com/justindarc/flot.touch" target="_blank">flot.touch.js</a> plugin adds multi-touch support to <a href="http://code.google.com/p/flot/" target="_blank">Flot</a> for supported browsers such as Mobile Safari. Gestures include swiping to pan and pinch-to-zoom. Panning and zooming can be constrained to a single axis if desired.</p>
<p>Using this plugin is as simple as including an additional <script/> tag after the Flot library is included:</p>
<pre><script type="text/javascript" src="jquery.flot.touch.js"></script></pre>
<p>The only pre-requisites are <a href="http://jquery.com" target="_blank">jQuery</a> and <a href="http://code.google.com/p/flot/" target="_blank">Flot</a>. This example was constructed using <a href="http://jquerymobile.com" target="_blank">jQuery Mobile</a> to provide mobile-friendly UI elements and screen constraints but it is not required.</p>
</div>
</div>
</body>
</html>