option
option = { tooltip : { formatter: "{a}
{b} : {c}%" }, toolbox: { show : true, feature : { mark : {show: true}, restore : {show: true}, saveAsImage : {show: true} } }, series : [ { name:'業務指標', type:'gauge', splitNumber: 10, // 分割段數,默認為5 axisLine: { // 坐標軸線 lineStyle: { // 屬性lineStyle控制線條樣式 color: [[0.2, '#228b22'],[0.8, '#48b'],[1, '#ff4500']], width: 8 } }, axisTick: { // 坐標軸小標記 splitNumber: 10, // 每份split細分多少段 length :12, // 屬性length控制線長 lineStyle: { // 屬性lineStyle控制線條樣式 color: 'auto' } }, axisLabel: { // 坐標軸文本標籤,詳見axis.axisLabel textStyle: { // 其餘屬性默認使用全局文本樣式,詳見TEXTSTYLE color: 'auto' } }, splitLine: { // 分隔線 show: true, // 默認顯示,屬性show控制顯示與否 length :30, // 屬性length控制線長 lineStyle: { // 屬性lineStyle(詳見lineStyle)控制線條樣式 color: 'auto' } }, pointer : { width : 5 }, title : { show : true, offsetCenter: [0, '-40%'], // x, y,單位px textStyle: { // 其餘屬性默認使用全局文本樣式,詳見TEXTSTYLE fontWeight: 'bolder' } }, detail : { formatter:'{value}%', textStyle: { // 其餘屬性默認使用全局文本樣式,詳見TEXTSTYLE color: 'auto', fontWeight: 'bolder' } }, data:[{value: 50, name: '完成率'}] } ] }; clearInterval(timeTicket); timeTicket = setInterval(function (){ option.series[0].data[0].value = (Math.random()*100).toFixed(2) - 0; myChart.setOption(option,true); },2000)
刷 新
切換主題