9cbf071e1d6290b8cc854a81271bcee3cb6fd50b
[dygraphs.git] / tests / color-cycle.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <link rel="stylesheet" href="../css/dygraph.css">
5 <title>color cycles</title>
6 <!--
7 For production (minified) code, use:
8 <script type="text/javascript" src="dygraph-combined.js"></script>
9 -->
10 <script type="text/javascript" src="../dist/dygraph.js"></script>
11
12 </head>
13 <body>
14 <p>Different color cycles</p>
15
16 <div id="blah"></div>
17 <p><b>Colors: </b>
18 <button type=button id=0 onClick="change(this)"> first set</button>
19 <button type=button id=1 onClick="change(this)"> second set</button>
20 <button type=button id=2 onClick="change(this)"> undefined</button>
21 </p>
22
23 <script type="text/javascript">
24 var colorSets = [
25 ['#284785', '#EE1111', '#8AE234'],
26 ['#444444', '#888888', '#DDDDDD'],
27 null
28 ]
29 chart = new Dygraph(document.getElementById("blah"),
30 "X,a,b,c\n" +
31 "10,12345,23456,34567\n" +
32 "11,12345,20123,31345\n",
33 {
34 width: 640,
35 height: 480,
36 colors: colorSets[0]
37 });
38
39 function change(el) {
40 chart.updateOptions({colors: colorSets[el.id]});
41 }
42 </script>
43 </body>
44 </html>