index.htm 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>Highcharts Example</title>
  6. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
  7. <script type="text/javascript">
  8. $(function () {
  9. $('#container').highcharts({
  10. chart: {
  11. type: 'scatter',
  12. margin: [70, 50, 60, 80],
  13. events: {
  14. click: function(e) {
  15. // find the clicked values and the series
  16. var x = e.xAxis[0].value,
  17. y = e.yAxis[0].value,
  18. series = this.series[0];
  19. // Add it
  20. series.addPoint([x, y]);
  21. }
  22. }
  23. },
  24. title: {
  25. text: 'User supplied data'
  26. },
  27. subtitle: {
  28. text: 'Click the plot area to add a point. Click a point to remove it.'
  29. },
  30. xAxis: {
  31. minPadding: 0.2,
  32. maxPadding: 0.2,
  33. maxZoom: 60
  34. },
  35. yAxis: {
  36. title: {
  37. text: 'Value'
  38. },
  39. minPadding: 0.2,
  40. maxPadding: 0.2,
  41. maxZoom: 60,
  42. plotLines: [{
  43. value: 0,
  44. width: 1,
  45. color: '#808080'
  46. }]
  47. },
  48. legend: {
  49. enabled: false
  50. },
  51. exporting: {
  52. enabled: false
  53. },
  54. plotOptions: {
  55. series: {
  56. lineWidth: 1,
  57. point: {
  58. events: {
  59. 'click': function() {
  60. if (this.series.data.length > 1) this.remove();
  61. }
  62. }
  63. }
  64. }
  65. },
  66. series: [{
  67. data: [[20, 20], [80, 80]]
  68. }]
  69. });
  70. });
  71. </script>
  72. </head>
  73. <body>
  74. <script src="../../js/highcharts.js"></script>
  75. <script src="../../js/modules/exporting.js"></script>
  76. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  77. </body>
  78. </html>