let echartsObj = echarts.init(document.querySelector('#canvas'));
option = {
color:['#429eda', '#8490ca', '#e97f74', '#f8d368', '#93cb76'],
legend: {
orient: 'vertical',
x: 'right',
y: 'center',
data:['America','Canada','Japan','Mexico','India']
},
series: [
{
type:'pie',
radius: ['50%', '70%'],
startAngle: 170,
center: ['30%', '50%'],
label: {
normal: {
show: false,
position: 'center'
},
emphasis: {
show: true,
textStyle: {
fontSize: '30',
fontWeight: 'bold'
}
}
},
labelLine: {
normal: {
show: false
}
},
data:[
{value:835, name:'America'},
{value:310, name:'Canada'},
{value:314, name:'Japan'},
{value:135, name:'Mexico'},
{value:948, name:'India'}
]
}
]
};
echartsObj.setOption(option)
<html>
<header>
<script src="https://cdn.bootcss.com/echarts/4.1.0.rc2/echarts-en.min.js"></script>
</header>
<body>
<div id="canvas" style="width: 100%; height: 300px">
</div>
</body>
</html>