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.

83 lines
1.6 KiB

9 years ago
  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. <style type="text/css">
  8. ${demo.css}
  9. </style>
  10. <script type="text/javascript">
  11. $(function () {
  12. $('#container').highcharts({
  13. data: {
  14. table: 'datatable'
  15. },
  16. chart: {
  17. type: 'column'
  18. },
  19. title: {
  20. text: 'Data extracted from a HTML table in the page'
  21. },
  22. yAxis: {
  23. allowDecimals: false,
  24. title: {
  25. text: 'Units'
  26. }
  27. },
  28. tooltip: {
  29. formatter: function () {
  30. return '<b>' + this.series.name + '</b><br/>' +
  31. this.point.y + ' ' + this.point.name.toLowerCase();
  32. }
  33. }
  34. });
  35. });
  36. </script>
  37. </head>
  38. <body>
  39. <script src="../../js/highcharts.js"></script>
  40. <script src="../../js/modules/data.js"></script>
  41. <script src="../../js/modules/exporting.js"></script>
  42. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  43. <table id="datatable">
  44. <thead>
  45. <tr>
  46. <th></th>
  47. <th>Jane</th>
  48. <th>John</th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. <tr>
  53. <th>Apples</th>
  54. <td>3</td>
  55. <td>4</td>
  56. </tr>
  57. <tr>
  58. <th>Pears</th>
  59. <td>2</td>
  60. <td>0</td>
  61. </tr>
  62. <tr>
  63. <th>Plums</th>
  64. <td>5</td>
  65. <td>11</td>
  66. </tr>
  67. <tr>
  68. <th>Bananas</th>
  69. <td>1</td>
  70. <td>1</td>
  71. </tr>
  72. <tr>
  73. <th>Oranges</th>
  74. <td>2</td>
  75. <td>4</td>
  76. </tr>
  77. </tbody>
  78. </table>
  79. </body>
  80. </html>