File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
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 >
You can’t perform that action at this time.
0 commit comments