You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.0 KiB

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <hmtl>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  4. <title>CurvedLines Plugin for flot</title>
  5. <script language="javascript" type="text/javascript" src="../flot/jquery.min.js"></script>
  6. <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../flot/excanvas.min.js"></script><![endif]-->
  7. <script language="javascript" type="text/javascript" src="../flot/jquery.flot.min.js"></script>
  8. <script language="JavaScript" type="text/javascript" src="../curvedLines.js"></script>
  9. <script language="JavaScript" type="text/javascript" src="_TestSetup.js"></script>
  10. <link rel="stylesheet" type="text/css" href="_TestSetup.css"></link>
  11. </head>
  12. <body>
  13. <div id="placeholder" style="width: 800;height: 400;"></div>
  14. <div id="parameters" style="width: 800"></div>
  15. <script id="source" language="javascript" type="text/javascript">
  16. $(function() {
  17. //data
  18. var d1 = [[20, 20], [42, 60], [54, 20], [80, 80]];
  19. var d2 = [[20, 700], [80, 300]];
  20. //general plot options
  21. var options = {
  22. series : {
  23. curvedLines : {
  24. active : true
  25. }
  26. },
  27. yaxes : [{
  28. min : 10,
  29. max : 90
  30. }, {
  31. position : 'right'
  32. }]
  33. };
  34. //curved line paramters
  35. var defaultParameters = {
  36. apply : true,
  37. legacyOverride : true
  38. }
  39. //plot function
  40. function replot(parameters) {
  41. $.plot($("#placeholder"), [{
  42. data : d1,
  43. lines : {
  44. show : true,
  45. fill : true,
  46. fillColor : "rgba(195, 195, 195, 0.4)",
  47. lineWidth : 3
  48. },
  49. curvedLines : parameters
  50. }, {
  51. data : d1,
  52. points : {
  53. show : true
  54. }
  55. }, {
  56. data : d2,
  57. lines : {
  58. show : true,
  59. lineWidth : 3
  60. },
  61. curvedLines : parameters,
  62. yaxis : 2
  63. }, {
  64. data : d2,
  65. points : {
  66. show : true
  67. },
  68. yaxis : 2
  69. }], options);
  70. };
  71. //combine everything
  72. TestSetup($("#parameters"), defaultParameters, [replot]);
  73. });
  74. </script>
  75. </body>
  76. </hmtl>