<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="js/echarts.min.js"></script>
</head>
<body>
<div id="main" style="width: 600px;height:400px;"></div>
</body>
<script type="text/javascript">
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
var option = {
title: {
text: 'bug分布'
},
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
color: ['#CD5C5C', '#00CED1', '#9ACD32', '#FFC0CB'],
stillShowZeroSum: false,
series: [
{
name: 'bug分布',
type: 'pie',
radius: '80%',
center: ['60%', '60%'],
data: [
{value: 1, name: '后台_bug'},
{value: 3, name: 'IOS_bug'},
{value: 7, name: 'Android_bug'},
{value: 4, name: 'H5_bug'},
],
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(128, 128, 128, 0.5)'
}
}
}
]
};
myChart.setOption(option);
</script>
</html>
网友评论