goals.html 1006 B

123456789101112131415161718192021222324252627282930313233
  1. <!doctype html>
  2. <head>
  3. <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
  4. <script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.2/raphael-min.js"></script>
  5. <script src="../morris.js"></script>
  6. <script src="http://cdnjs.cloudflare.com/ajax/libs/prettify/r224/prettify.min.js"></script>
  7. <script src="lib/example.js"></script>
  8. <link rel="stylesheet" href="lib/example.css">
  9. <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/prettify/r224/prettify.min.css">
  10. <link rel="stylesheet" href="../morris.css">
  11. </head>
  12. <body>
  13. <h1>Value Goals</h1>
  14. <div id="graph"></div>
  15. <pre id="code" class="prettyprint linenums">
  16. var decimal_data = [];
  17. for (var x = 0; x <= 360; x += 10) {
  18. decimal_data.push({
  19. x: x,
  20. y: Math.sin(Math.PI * x / 180).toFixed(4)
  21. });
  22. }
  23. window.m = Morris.Line({
  24. element: 'graph',
  25. data: decimal_data,
  26. xkey: 'x',
  27. ykeys: ['y'],
  28. labels: ['sin(x)'],
  29. parseTime: false,
  30. goals: [-1, 0, 1]
  31. });
  32. </pre>
  33. </body>