Use CSS for tests, gallery and docs
[dygraphs.git] / tests / connect-separated.html
CommitLineData
54425b14 1<!DOCTYPE html>
563c70ca
AV
2<html>
3 <head>
93a5bb4c 4 <link rel="stylesheet" href="../css/dygraph.css">
563c70ca 5 <title>connect separated</title>
7e5ddc94
DV
6 <!--
7 For production (minified) code, use:
8 <script type="text/javascript" src="dygraph-combined.js"></script>
9 -->
fbd6834a 10 <script type="text/javascript" src="../dist/dygraph.js"></script>
7e5ddc94 11
563c70ca
AV
12 </head>
13 <body>
14 <p>Connecting separated points. All three of the series should have their points
15 connected with lines, and hovering over them should produce dot and legend
16 overlays in the proper color.</p>
67b65269 17
563c70ca 18 <div id="graphdiv" style="width:600px; height:300px;"></div>
b85358e2
RK
19<p><b>Toggle ConnectSeparated:<b></p>
20<p>
21 All: <button id="All" onclick="change(this)">true</button>
22 Series 1 <button id="Series1" onclick="change(this)">disabled</button>
23 Series 2 <button id="Series2" onclick="change(this)">disabled</button>
24 Series 3 <button id="Series3" onclick="change(this)">disabled</button>
25</p>
563c70ca 26 <script type="text/javascript">
f6fbf9e0 27 var g = new Dygraph(document.getElementById("graphdiv"),
563c70ca
AV
28 [
29 [ new Date("2009/12/01"), 10, 10, 10],
30 [ new Date("2009/12/02"), 15, 11, 12],
31 [ new Date("2009/12/03"), null, null, 12],
32 [ new Date("2009/12/04"), 20, 14, null],
33 [ new Date("2009/12/05"), 15, null, 17],
0209e56f
AV
34 [ new Date("2009/12/06"), 18, null, null],
35 [ new Date("2009/12/07"), 12, 14, null]
563c70ca
AV
36 ],
37 {
38 connectSeparatedPoints: true,
31b1e394 39 labels: ["Date","Series1","Series2","Series3"]
563c70ca 40 });
b85358e2
RK
41
42 function change(el) {
43 var textSequences = [ "disabled", "true", "false" ];
44 var values = [ null, true, false ];
45 for (var idx = 0; idx < textSequences.length; idx++) {
46 if (textSequences[idx] == el.textContent) {
47 var nextIdx = (idx + 1) % 3;
48 var nextVal = values[nextIdx];
49 el.textContent = textSequences[nextIdx];
50
7e64db42 51 if (el.id == "All") {
b85358e2
RK
52 g.updateOptions({ connectSeparatedPoints : nextVal });
53 } else {
54 var seriesOpt = {};
55 seriesOpt[el.id] = { connectSeparatedPoints : nextVal };
56 g.updateOptions({ series : seriesOpt });
57 }
58 break;
59 }
60 }
61 }
563c70ca
AV
62 </script>
63 </body>
64</html>