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.

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