UNPKG

dcos-dygraphs

Version:

dygraphs is a fast, flexible open source JavaScript charting library.

43 lines (38 loc) 1.33 kB
<!DOCTYPE html> <html> <head> <title>color visibility</title> <!-- For production (minified) code, use: <script type="text/javascript" src="dygraph-combined.js"></script> --> <script type="text/javascript" src="../dist/dygraph.js"></script> </head> <body> <p>The lines should maintain their colors as their visibility is toggled.</p> <div id="blah"></div> <p><b>Display: </b> <input type=checkbox id=0 onClick="change(this)" checked> <label for="0"> a</label> <input type=checkbox id=1 onClick="change(this)" checked> <label for="1"> b</label> <input type=checkbox id=2 onClick="change(this)" checked> <label for="2"> c</label> </p> <script type="text/javascript"> chart = new Dygraph(document.getElementById("blah"), "X,a,b,c\n" + "10,12345,23456,34567\n" + "11,12345,20123,31345\n", { width: 640, height: 480, colors: ['#284785', '#EE1111', '#8AE234'], visibility: [true, true, true] }); function change(el) { chart.setVisibility(el.id, el.checked); } </script> </body> </html>