index.htm 1.7 KB

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