<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="echarts.js"></script>
<style>
* {
padding: 0;
margin: 0;
}
.container {
width: 600px;
height: 500px;
}
</style>
</head>
<body>
<div class="container"></div>
<script>
const container = document.querySelector('.container')
var myEcharts = echarts.init(container)
var options = {
title: {
text: '南丁格尔图',
subtext: '测试'
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
toolbox: {
show: true,
feature: {
mark: { show: true },
dataView: { show: true, readOnly: false },
restore: { show: true },
saveAsImage: { show: true }
}
},
series: [
{
name: 'Radius Mode',
type: 'pie',
radius: [20, 140],//设置半径大小
center: ['25%', '50%'],
roseType: 'radius',
itemStyle: {
borderRadius: 15
},
label: {
show: false
},
emphasis: {
label: {
show: true
}
},
data: [
{ value: 40, name: 'rose 1' },
{ value: 33, name: 'rose 2' },
{ value: 28, name: 'rose 3' },
{ value: 22, name: 'rose 4' },
{ value: 20, name: 'rose 5' },
{ value: 15, name: 'rose 6' },
{ value: 12, name: 'rose 7' },
{ value: 10, name: 'rose 8' }
]
},
]
}
myEcharts.setOption(options)
</script>
</body>
</html>
06-16
3340
02-28
379
03-11
2410
04-17
246