如何添加时间轴 根据数据库实时更新数据!
配置项如下
var data = [{value: 3661,name: '原煤'},
{value: 5713,name: '精煤'},
{value: 9938,name: '中块'},
{value: 17623,name: '小块'},
{value: 3299,name: '粒煤'}
];
option = {
backgroundColor: '#192532',
title: {
text: '综合产率',
subtext: '80%',
x: 'center',
y: 'center',
textStyle: {
color: '#fff',
fontWeight: 'normal',
fontSize: 22
}
},
tooltip: {
show: true,
trigger: 'item',
formatter: "{b}: {c} ({d}%)"//提示框显示数据&百分比
},
legend: {
orient: 'vertical',
bottom: '70%',
x: 'left',
textStyle: {
color: '#fff',
fontWeight: 'normal',
fontSize: 22
},
data: ['原煤', '精煤', '中块', '小块', '粒煤']
},
series: [{
type: 'pie',
selectedMode: 'single',
radius: ['25%', '58%'],
// color: ['#8fbc8f', '#AF89D6', '#59ADF3', '#FF999A', '#bdb76b'],
label: {
normal: {
position: 'inner',
formatter: '{d}%',
textStyle: {
color: '#fff',
fontWeight: 'bold',
fontSize: 24
}
}
},
data: data
}, {
type: 'pie',
radius: ['56%', '79%'],
itemStyle: {
normal: {
color: '#556b'
},
emphasis: {
color: '#7b0e39'
}
},
label: {
normal: {
position: 'inner',
formatter: '{c}吨',
textStyle: {
color: '#ff',
fontWeight: 'bold',
fontSize: 21
}
}
},
data: data
},
{
type: 'pie',
radius: ['80%', '82%'],
itemStyle: {
normal: {
// color: '#556bb2'/定义外圈颜色
},
emphasis: {
color: '#7b0e39'
}
},
label: {
normal: {
//position: 'inner',
//formatter: '{c}吨',
textStyle: {
color: '#ff',
fontWeight: 'bold',
fontSize: 21
}
}
},
data: data},]
};