index.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>Flot Examples: Basic Options</title>
  6. <link href="../examples.css" rel="stylesheet" type="text/css">
  7. <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../../excanvas.min.js"></script><![endif]-->
  8. <script language="javascript" type="text/javascript" src="../../jquery.js"></script>
  9. <script language="javascript" type="text/javascript" src="../../jquery.flot.js"></script>
  10. <script type="text/javascript">
  11. $(function () {
  12. var d1 = [];
  13. for (var i = 0; i < Math.PI * 2; i += 0.25) {
  14. d1.push([i, Math.sin(i)]);
  15. }
  16. var d2 = [];
  17. for (var i = 0; i < Math.PI * 2; i += 0.25) {
  18. d2.push([i, Math.cos(i)]);
  19. }
  20. var d3 = [];
  21. for (var i = 0; i < Math.PI * 2; i += 0.1) {
  22. d3.push([i, Math.tan(i)]);
  23. }
  24. $.plot("#placeholder", [
  25. { label: "sin(x)", data: d1 },
  26. { label: "cos(x)", data: d2 },
  27. { label: "tan(x)", data: d3 }
  28. ], {
  29. series: {
  30. lines: { show: true },
  31. points: { show: true }
  32. },
  33. xaxis: {
  34. ticks: [
  35. 0, [ Math.PI/2, "\u03c0/2" ], [ Math.PI, "\u03c0" ],
  36. [ Math.PI * 3/2, "3\u03c0/2" ], [ Math.PI * 2, "2\u03c0" ]
  37. ]
  38. },
  39. yaxis: {
  40. ticks: 10,
  41. min: -2,
  42. max: 2,
  43. tickDecimals: 3
  44. },
  45. grid: {
  46. backgroundColor: { colors: [ "#fff", "#eee" ] },
  47. borderWidth: {
  48. top: 1,
  49. right: 1,
  50. bottom: 2,
  51. left: 2
  52. }
  53. }
  54. });
  55. // Add the Flot version string to the footer
  56. $("#footer").prepend("Flot " + $.plot.version + " &ndash; ");
  57. });
  58. </script>
  59. </head>
  60. <body>
  61. <div id="header">
  62. <h2>Basic Options</h2>
  63. </div>
  64. <div id="content">
  65. <div class="demo-container">
  66. <div id="placeholder" class="demo-placeholder"></div>
  67. </div>
  68. <p>There are plenty of options you can set to control the precise looks of your plot. You can control the ticks on the axes, the legend, the graph type, etc.</p>
  69. <p>Flot goes to great lengths to provide sensible defaults so that you don't have to customize much for a good-looking result.</p>
  70. </div>
  71. <div id="footer">
  72. Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
  73. </div>
  74. </body>
  75. </html>