8000 Added xgap example. · leetcode/flot-plugin-collection@9523574 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9523574

Browse files
committed
Added xgap example.
1 parent d609348 commit 9523574

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

examples/xgap.html

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<title>X Gap Threshold Example</title>
6+
<script language="javascript" type="text/javascript" src="../src/jquery-1.4.min.js"></script>
7+
<script language="javascript" type="text/javascript" src="../src/flot/jquery.flot.js"></script>
8+
<script language="javascript" type="text/javascript" src="../src/flot/jquery.flot.xgap.js"></script>
9+
10+
<script language="javascript" type="text/javascript" src="data.js"></script>
11+
</head>
12+
13+
<body>
14+
15+
<script language="javascript" type="text/javascript">
16+
$(document).ready(function() {
17+
var plot,
18+
container = $('#plot'),
19+
options = {},
20+
s1 = { data: [] };
21+
22+
// generate data series
23+
for (var i = 0; i < 1000; i += 0.5) {
24+
if (i < 500 || i > 750) s1.data.push([i, 2 + $generate.sin(i / 20)]);
25+
}
26+
27+
// enable gap insertion and set the color of the gap
28+
options.xaxis = {
29+
insertGaps: true,
30+
gapColor: 'rgba(255,0,0,0.2)'
31+
}
32+
33+
// set the maximum grab before breaking the line
34+
s1.xGapThresh = 0.5;
35+
36+
// plot the graph
37+
plot = $.plot(container, [ s1 ], options);
38+
});
39+
</script>
40+
41+
<div id="plot" style="width:600px;height:200px;"></div>
42+
</body>
43+
</html>

0 commit comments

Comments
 (0)
0