绘制类似的3D饼图时,echart已经无法满足要求了!
百度查找使用highcharts就可以了。可以参考官方文档:https://api.highcharts.com.cn/highcharts
直接复制DEMO代码就可以云行了
<html>
<head>
<meta charset="UTF-8" />
<title>饼图</title>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script src="https://cdn.highcharts.com.cn/highcharts/highcharts.js"></script>
<script src="https://cdn.highcharts.com.cn/highcharts/highcharts-3d.js"></script>
</head>
<body>
<div >['+ this.point.name +' '+ Highcharts.numberFormat(this.percentage, 2)+'%]</span>';
}
}
/* style: {
fontSize: '10px',//设置字体大小
fontFamily: 'Verdana, sans-serif'
}*/
}
}
};
var series= [{
type: 'pie',
name: 'Browser share',
startAngle: 180,//调整饼图的角度 方向:顺时针
data: [
['中国', 45.0],
['美国', 16.8],
{
name: '俄罗斯',
y: 22.8,
sliced: true,
selected: true
},
['英国', 8.5],
['朝鲜', 6.2],
['日本', 0.1]
]
}];
var json = {};
json.chart = chart;
json.title = title;
json.tooltip = tooltip;
json.colors = colors; // 设置饼图颜色
json.credits = credits;
json.plotOptions = plotOptions;
json.series = series;
$('#container').highcharts(json);
});
</script>
</body>
</html>
遇到问题:文字总是有白色描边,去掉办法:
style:{
color:'#eee',
fontSize:'14px',
textOutline:"none"
}
转自于:https://www.cnblogs.com/xiaomg/articles/10382506.html