2020-01-04 06:46:39 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2021-01-16 03:24:07 +00:00
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>ECharts</title>
|
|
|
|
<script src="echarts.min.js"></script>
|
2020-01-04 06:46:39 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2021-01-16 03:24:07 +00:00
|
|
|
<div id="main" style="height:300px;"></div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
var myChart = echarts.init(document.getElementById('main'));
|
|
|
|
function setGaugeValue(value){
|
2020-01-04 06:46:39 +00:00
|
|
|
var option = {
|
|
|
|
tooltip : {
|
|
|
|
formatter: "{a} <br/>{b} : {c}%"
|
|
|
|
},
|
|
|
|
toolbox: {
|
|
|
|
feature: {
|
|
|
|
restore: {},
|
|
|
|
saveAsImage: {}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
series: [
|
|
|
|
{
|
|
|
|
name: '业务指标',
|
|
|
|
type: 'gauge',
|
|
|
|
detail: {formatter:'{value}%'},
|
|
|
|
data: [{value: value, name: '完成率'}]
|
|
|
|
}
|
|
|
|
]
|
2021-01-16 03:24:07 +00:00
|
|
|
};
|
|
|
|
myChart.setOption(option);
|
|
|
|
}
|
|
|
|
window.onresize = myChart.resize;
|
|
|
|
setGaugeValue(68);
|
|
|
|
</script>
|
2020-01-04 06:46:39 +00:00
|
|
|
</body>
|
|
|
|
</html>
|