HTML实现饼状图完整源码及效果图(附源码)效果图
实现源码:
<!DOCTYPE html>
<html >
<head>
<meta charset="utf-8">
</head>
<body >
<div id="container" ></div>
<script type="text/javascript" src="echarts.baidu/gallery/vendors/echarts/echarts.min.js"></script>
<script type="text/javascript">
var dom = ElementById("container");
var myChart = echarts.init(dom);
var app = {};
app.title = '环形图';
var option = {
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b}: {c} ({d}%)"
},
color:['#93D8A9','#FFB99D','#AF7DCC','#FFD83D','#bbe2e8'],
legend: {
orient: 'horizontal',
x: 'left',
data: ['直接访问', '邮件营销', '联盟⼴告', '视频⼴告', '搜索引擎']
},
html导航源码series: [{
name: '访问来源',
type: 'pie',
radius: ['30%', '70%'],
avoidLabelOverlap: false,
label: {
normal: {
normal: {
show: false,
position: 'center'
},
emphasis: {
show: true,
textStyle: {
fontSize: '30',
fontWeight: 'bold'
}
}
},
labelLine: {
normal: {
show: false
}
},
data: [{
value: 335,
name: '直接访问'
},
{
value: 310,
name: '邮件营销'
},
{
value: 234,
name: '联盟⼴告'
},
{
value: 135,
name: '视频⼴告'
},
{
value: 1548,
name: '搜索引擎'
}
]
}]
};
if(option && typeof option === "object") {    myChart.setOption(option, true);
}
</script>
</body>
</html>
饼状图其它属性配置⽂档地址:

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。