152Echarts - 旭日图(Basic Sunburst)

简介: 152Echarts - 旭日图(Basic Sunburst)
效果图

源代码
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>ECharts</title>
    <!-- 引入 echarts.js -->
    <script src="js/echarts.min.js"></script>
    <script src="js/jquery-1.11.0.min.js"></script>
    <script src="dist/extension/dataTool.js"></script>
  </head>
  <body>
    <!-- 为ECharts准备一个具备大小(宽高)的Dom -->
    <div id="main" style="width: 1024px;height:768px;"></div>
    <script type="text/javascript">
      // 基于准备好的dom,初始化echarts实例
      var myChart = echarts.init(document.getElementById('main'));
      var option;
var data = [{
    name: 'Grandpa',
    children: [{
        name: 'Uncle Leo',
        value: 15,
        children: [{
            name: 'Cousin Jack',
            value: 2
        }, {
            name: 'Cousin Mary',
            value: 5,
            children: [{
                name: 'Jackson',
                value: 2
            }]
        }, {
            name: 'Cousin Ben',
            value: 4
        }]
    }, {
        name: 'Father',
        value: 10,
        children: [{
            name: 'Me',
            value: 5
        }, {
            name: 'Brother Peter',
            value: 1
        }]
    }]
}, {
    name: 'Nancy',
    children: [{
        name: 'Uncle Nike',
        children: [{
            name: 'Cousin Betty',
            value: 1
        }, {
            name: 'Cousin Jenny',
            value: 2
        }]
    }]
}];
option = {
    series: {
        type: 'sunburst',
        // highlightPolicy: 'ancestor',
        data: data,
        radius: [0, '90%'],
        label: {
            rotate: 'radial'
        }
    }
};
      myChart.setOption(option);
    </script>
  </body>
</html>
目录
相关文章
146Echarts - 矩形树图(Basic Treemap)
146Echarts - 矩形树图(Basic Treemap)
211 0
105Echarts - K 线图(Basic Candlestick)
105Echarts - K 线图(Basic Candlestick)
65 0
163Echarts - 桑基图(Basic Sankey)
163Echarts - 桑基图(Basic Sankey)
76 0
157Echarts - 平行坐标系(Basic Parallel)
157Echarts - 平行坐标系(Basic Parallel)
38 0
153Echarts - 旭日图(Sunburst VisualMap)
153Echarts - 旭日图(Sunburst VisualMap)
91 0
151Echarts - 旭日图(Monochrome Sunburst)
151Echarts - 旭日图(Monochrome Sunburst)
69 0
150Echarts - 旭日图(Sunburst Label Rotate)
150Echarts - 旭日图(Sunburst Label Rotate)
87 0
149Echarts - 旭日图(Drink Flavors)
149Echarts - 旭日图(Drink Flavors)
79 0
148Echarts - 旭日图(Book Records)
148Echarts - 旭日图(Book Records)
68 0
108Echarts - 雷达图(Basic Radar Chart)
108Echarts - 雷达图(Basic Radar Chart)
45 0