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.

62 lines
1.6 KiB

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <title>Basic example with multi axis and fill | CurvedLines</title>
  4. <style>
  5. .chart-style {
  6. width: 500px;
  7. height: 300px;
  8. }
  9. </style>
  10. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
  11. <script type="text/javascript" src="https://cdn.rawgit.com/flot/flot/v0.8.3/jquery.flot.js"></script>
  12. <script type="text/javascript" src="https://rawgit.com/MichaelZinsmaier/CurvedLines/master/curvedLines.js"></script>
  13. <script type="text/javascript">
  14. $(function() {
  15. var d1 = [[20,20], [42,60], [54, 20], [80,80]];
  16. var d2 = [[20,700], [80,300]];
  17. //flot options
  18. var options = {
  19. series: {
  20. curvedLines: {active: true}
  21. },
  22. yaxes: [{ min:10, max: 90}, {position: 'right'}]
  23. };
  24. //plotting
  25. $.plot($("#flotContainer"),[
  26. {
  27. data: d1,
  28. lines: { show: true, fill: true, fillColor: "#C3C3C3", lineWidth: 3},
  29. //curve the line (old pre 1.0.0 plotting function)
  30. curvedLines: {
  31. apply: true,
  32. legacyOverride: true // <- use legacy plotting function
  33. }
  34. }, {
  35. data: d1,
  36. points: { show: true }
  37. }, {
  38. data: d2,
  39. yaxis: 2,
  40. lines: { show: true, lineWidth: 3},
  41. }, {
  42. data: d2,
  43. yaxis: 2,
  44. points: { show: true }
  45. }
  46. ], options);
  47. });
  48. </script>
  49. </head>
  50. <body>
  51. <h4>CurvedLines Basic example with multi axis and fill</h4>
  52. <div id="flotContainer" class="chart-style"></div>
  53. <a href="index.html">Return to CurvedLines Examples list</a>
  54. </body>
  55. </html>