市长热线演示版

index.htm 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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://cdn.hcharts.cn/jquery/jquery-1.8.3.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. gridLineWidth: 1,
  32. minPadding: 0.2,
  33. maxPadding: 0.2,
  34. maxZoom: 60
  35. },
  36. yAxis: {
  37. title: {
  38. text: 'Value'
  39. },
  40. minPadding: 0.2,
  41. maxPadding: 0.2,
  42. maxZoom: 60,
  43. plotLines: [{
  44. value: 0,
  45. width: 1,
  46. color: '#808080'
  47. }]
  48. },
  49. legend: {
  50. enabled: false
  51. },
  52. exporting: {
  53. enabled: false
  54. },
  55. plotOptions: {
  56. series: {
  57. lineWidth: 1,
  58. point: {
  59. events: {
  60. 'click': function() {
  61. if (this.series.data.length > 1) this.remove();
  62. }
  63. }
  64. }
  65. }
  66. },
  67. series: [{
  68. data: [[20, 20], [80, 80]]
  69. }]
  70. });
  71. });
  72. </script>
  73. </head>
  74. <body>
  75. <script src="../../js/highcharts.js"></script>
  76. <script src="../../js/modules/exporting.js"></script>
  77. <div id="container" style="min-width: 310px; height: 400px; max-width: 700px; margin: 0 auto"></div>
  78. </body>
  79. </html>