index.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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: Symbols</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 language="javascript" type="text/javascript" src="../../jquery.flot.symbol.js"></script>
  11. <script type="text/javascript">
  12. $(function() {
  13. function generate(offset, amplitude) {
  14. var res = [];
  15. var start = 0, end = 10;
  16. for (var i = 0; i <= 50; ++i) {
  17. var x = start + i / 50 * (end - start);
  18. res.push([x, amplitude * Math.sin(x + offset)]);
  19. }
  20. return res;
  21. }
  22. var data = [
  23. { data: generate(2, 1.8), points: { symbol: "circle" } },
  24. { data: generate(3, 1.5), points: { symbol: "square" } },
  25. { data: generate(4, 0.9), points: { symbol: "diamond" } },
  26. { data: generate(6, 1.4), points: { symbol: "triangle" } },
  27. { data: generate(7, 1.1), points: { symbol: "cross" } }
  28. ];
  29. $.plot("#placeholder", data, {
  30. series: {
  31. points: {
  32. show: true,
  33. radius: 3
  34. }
  35. },
  36. grid: {
  37. hoverable: true
  38. }
  39. });
  40. // Add the Flot version string to the footer
  41. $("#footer").prepend("Flot " + $.plot.version + " &ndash; ");
  42. });
  43. </script>
  44. </head>
  45. <body>
  46. <div id="header">
  47. <h2>Symbols</h2>
  48. </div>
  49. <div id="content">
  50. <div class="demo-container">
  51. <div id="placeholder" class="demo-placeholder"></div>
  52. </div>
  53. <p>Points can be marked in several ways, with circles being the built-in default. For other point types, you can define a callback function to draw the symbol. Some common symbols are available in the symbol plugin.</p>
  54. </div>
  55. <div id="footer">
  56. Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
  57. </div>
  58. </body>
  59. </html>