Toggle navigation
树状图如何翻过来显示 和 根节点在中间左右两边都有分支
By
小呀小星星星星
2017-12-01 03:19:43
脚本
16
21
作品使用的第三方脚本
数据管理
上传数据
支持小于 5M 任意格式(csv, xlsx, json, xml, ...)的数据文件
上传后可以通过生成的文件链接异步获取托管的数据。
历史数据
0 条
无历史数据
代码修改记录
信息提示
保存作品
对当前截图不满意?你还可以
上传本地截图
重新截图
作品名称
作品描述
标签
geo
grid
legend
markLine
markPoint
bar
effectScatter
line
lines
map
timeline
title
toolbox
tooltip
visualMap
作品默认版本
最新
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
20:11:45
图表已生成
整理代码
刷新
代码
option = { tooltip: { trigger: 'item', formatter: '{b}:{c}', hideDelay: 0, animationDurationUpdate: 1500, animationEasingUpdate: 'quinticInOut', geo: { roam: true, show: true } }, series: [{ name: '树图', type: 'tree', orient: 'horizontal', initialTreeDepth: -1, rootLocation: { x: 'right', y: '10%' }, // 根节点位置 {x: ‘center‘,y: 10} nodePadding: 10, //智能定义全局最小节点间距,不能定义层级节点间距。 symbolSize: [30,30], symbol: 'circle', itemStyle: { normal: { label: { show: true, position: 'bottom', }, distance: 10, } }, lineStyle: { normal:{ color: 'gray', type: 'solid', symbol: 'arrow', }, }, data: [{ name: '根节点', value: 6, symbol: 'circle', children: [ { name: '二节点', //由于label的formatter存在bug,所以无法通过html进行格式化,如果要换行要用\n value: 4, children: [{ name: '三节点', value: 4, children: [{ name:'四节点', children: [ { name:'五节点', value: 10, } ] },{ name:'四节点', value: 10, children: [ { name:'五节点', value: 10, } ] }] },{ name: '三节点', value: 6, children: [ { name:'四节点', value: 5, } ] },] }, ] }] }] };