日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

echarts 树图样式美化_echarts树图tree改为流程图

發(fā)布時(shí)間:2024/1/23 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 echarts 树图样式美化_echarts树图tree改为流程图 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Title

var _data =[];var _flows =[

[

{"name": "步驟1", "id": 87, "count": 2,},

{"name": "步驟2", "id": 88, "count": 2,},

{"name": "步驟3", "id": 89, "count": 2,},

{"name": "步驟4", "id": 90, "count": 2,},

{"name": "步驟5", "id": 91, "count": 2,}],

[

{"name": "步驟1", "id": 74, "count": 2,},

{"name": "步驟1", "id": 75, "count": 2,},

{"name": "步驟1", "id": 76, "count": 2,}

]

];

$.each(_flows,function(i, v) {var_current;

$.each(v.reverse(),function(j, k) {if (j === 0) {

_current={"name": k.name,"value": k.count ? k.count : 0}

}else{

_current={"name": k.name,"value": k.count ? k.count : 0,"children": [_current]

}

}

})

_data.push(_current)

})/*以上是數(shù)據(jù)的操作,為了組成樹形結(jié)構(gòu)數(shù)據(jù),可以忽略*/

//每條流程高度100px 動(dòng)態(tài)設(shè)置畫布高度

$('#processFlow').css('height', 100 *_data.length);var myChart = echarts.init(document.getElementById('processFlow'));var data ={"name": '流程',"value": 16,"children": _data

};var option ={

backgroundColor:'#cc2693',

tooltip: {

show:false,

trigger:'item',

triggerOn:'mousemove'},

series: [

{

type:'tree',

id:0,

name:'tree1',

data: [data],

layout:'orthogonal',

top:'10%',

left:'8%',

bottom:'22%',

right:'20%',

symbolSize:7,

edgeShape:'polyline',

edgeForkPosition:'63%',

initialTreeDepth:-1,//初始展開的層級(jí)(深度)

//小圓點(diǎn)

itemStyle: {

color:'#C9924B',

borderColor:'#C9924B',

},

lineStyle: {

curveness:0.5,//線的曲度

width: 2//線寬

},

label: {

backgroundColor:'#f2f2f2',

position:'inside',

verticalAlign:'middle',

align:'center',

borderColor:'#e6e6e6',

borderWidth:2,

borderRadius:5,

padding:5,

height:40,

formatter:function(data) {return ['{name| ' + data.name + ' }', '{value| ' + data.value + ' }'].join('\n');

},

rich: {//給不同的數(shù)據(jù)應(yīng)用不同的樣式

name: {

color:'#000',

fontSize:14,

lineHeight:20,

},

value: {

color:'#000',

fontSize:14,

lineHeight:20,

fontWeight:'bold',

},

}

},

leaves: {

label: {

position:'inside',

verticalAlign:'middle',

align:'center'}

},

expandAndCollapse:false,

animationDuration:550,

animationDurationUpdate:750,

roam:true,//是否開啟鼠標(biāo)縮放和平移漫游 如果版本太低的話 這里是不生效的 我用的是4.2.1

}

]

};//使用剛指定的配置項(xiàng)和數(shù)據(jù)顯示圖表。

myChart.setOption(option);

window.οnresize= function() {

myChart.resize();

}

總結(jié)

以上是生活随笔為你收集整理的echarts 树图样式美化_echarts树图tree改为流程图的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。