案例:Highcharts案例     状态:可编辑再运行    进入竖版
 运行结果 
AخA
 
1
<html>
2
<head>
3
<meta charset="UTF-8" />
4
<title>Highcharts 教程 | W3xue教程(w3xue.com)</title>
5
<script src="/js/jquery-2.1.4.min.js"></script>
6
<script src="https://code.highcharts.com/highcharts.js"></script>
7
<script src="https://code.highcharts.com/modules/treemap.js"></script>
8
<script src="https://code.highcharts.com/modules/heatmap.js"></script>
9
</head>
10
<body>
11
<div id="container" style="width: 550px; height: 400px; margin: 0 auto"></div>
12
<script language="JavaScript">
13
$(document).ready(function() {    
14
   var title = {
15
      text: 'Fruit consumption'   
16
   };        
17
   
18
   var series = [{
19
      type: "treemap",
20
      layoutAlgorithm: 'stripes',
21
      alternateStartingDirection: true,
22
      levels: [{
23
         level: 1,
24
         layoutAlgorithm: 'sliceAndDice',
25
         dataLabels: {
26
            enabled: true,
27
            align: 'left',
28
            verticalAlign: 'top',
29
            style: {
30
               fontSize: '15px',
31
               fontWeight: 'bold'
32
            }
33
         }
34
      }],
35
      data: [{
36
         id: 'A',
37
         name: 'Apples',
38
         color: "#EC2500"
39
      }, {
40
         id:'B',
41
         name: 'Bananas',
42
         color: "#ECE100"
43
      }, {
44
         id: 'O',
45
         name: 'Oranges',
46
         color: '#EC9800'
47
      }, {
48
         name: 'Anne',