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.

68 lines
1.6 KiB

8 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. #container {
  9. min-width: 300px;
  10. max-width: 600px;
  11. margin: 0 auto;
  12. }
  13. </style>
  14. <script type="text/javascript">
  15. $(function () {
  16. $('#container').highcharts({
  17. colorAxis: {
  18. minColor: '#FFFFFF',
  19. maxColor: Highcharts.getOptions().colors[0]
  20. },
  21. series: [{
  22. type: "treemap",
  23. layoutAlgorithm: 'squarified',
  24. data: [{
  25. name: 'A',
  26. value: 6,
  27. colorValue: 1
  28. }, {
  29. name: 'B',
  30. value: 6,
  31. colorValue: 2
  32. }, {
  33. name: 'C',
  34. value: 4,
  35. colorValue: 3
  36. }, {
  37. name: 'D',
  38. value: 3,
  39. colorValue: 4
  40. }, {
  41. name: 'E',
  42. value: 2,
  43. colorValue: 5
  44. }, {
  45. name: 'F',
  46. value: 2,
  47. colorValue: 6
  48. }, {
  49. name: 'G',
  50. value: 1,
  51. colorValue: 7
  52. }]
  53. }],
  54. title: {
  55. text: 'Highcharts Treemap'
  56. }
  57. });
  58. });
  59. </script>
  60. </head>
  61. <body>
  62. <script src="../../js/highcharts.js"></script>
  63. <script src="../../js/modules/heatmap.js"></script>
  64. <script src="../../js/modules/treemap.js"></script>
  65. <div id="container"></div>
  66. </body>
  67. </html>