<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Echarts图表</title>
<!-- 引入echarts.min.js -->
<script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
</head>
<body>
<div id="main" style="width: 600px;height:400px;"></div>
<script type="text/javascript">
var myChart = echarts.init(document.getElementById('main'));
var e = 55;
var option = {
color: ['#121c28', '#fecb89'],
backgroundColor:'rgba(1,202,217,.2)',
title: {
show: true,
text: '消防',
x: 'center',
y: 'center',
textStyle: {
fontSize: '15',
color: '#fecb89',
fontWeight: 'normal'
}
},
// 提示框不显示
tooltip: {
trigger: 'item',
formatter: '{e}%',
show: false
},
legend: {
textStyle: {
fontSize: 15,
color: 'rgba(255,255,255)'
},
},
series: {
name: '',
type: 'pie',
radius: ['50%', '70%'],
center: ['50%', '50%'],
avoidLabelOverLap: true,
hoverAnimation: false,
// 设置标签不显示
label: {
normal: {
show: false,
position: 'center'
},
emphasis: {
show: false
}
},
// 设置标签线条不显示
labelLine: {
normal: {
show: false
}
},
data: [{
value: e,
name: ''
},
{
value: 100 - e,
name: '消防'
}
]
}
}
myChart.setOption(option);
</script>
</body>
</html>
Echarts图表之圆形进度条(一)
最新推荐文章于 2024-06-27 10:31:04 发布