index.htm 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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: 'column'
  12. },
  13. title: {
  14. text: 'Stacked column chart'
  15. },
  16. xAxis: {
  17. categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
  18. },
  19. yAxis: {
  20. min: 0,
  21. title: {
  22. text: 'Total fruit consumption'
  23. }
  24. },
  25. tooltip: {
  26. pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.percentage:.0f}%)<br/>',
  27. shared: true
  28. },
  29. plotOptions: {
  30. column: {
  31. stacking: 'percent'
  32. }
  33. },
  34. series: [{
  35. name: 'John',
  36. data: [5, 3, 4, 7, 2]
  37. }, {
  38. name: 'Jane',
  39. data: [2, 2, 3, 2, 1]
  40. }, {
  41. name: 'Joe',
  42. data: [3, 4, 4, 2, 5]
  43. }]
  44. });
  45. });
  46. </script>
  47. </head>
  48. <body>
  49. <script src="../../js/highcharts.js"></script>
  50. <script src="../../js/modules/exporting.js"></script>
  51. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  52. </body>
  53. </html>