<div class="statistics-echarts" id="diseaseStatistics"></div>
MyHighCharts = HighCharts.chart("diseaseStatistics", {
title: {
text: "",
},
// 禁用右下角版权信息
credits: {
enabled: false,
},
chart: {
// 放置图表的div的id
renderTo: "diseaseStatistics",
type: "pie",
backgroundColor: "transparent",
options3d: {
enabled: true,
alpha: 48, // 内旋转角度
// beta: 0, // 外旋转角度
},
},
plotOptions: {
pie: {
// 是否允许被点击,为true时点击饼图的一块
// allowPointSelect: true,
// 鼠标样式为小手
cursor: "pointer",
// 内径
innerSize: 100,
// 饼图的厚度
depth: 35,
dataLabels: {
enabled: true,
color: "#fff",
// userHtml: true, // 是否使用formatter内的标签样式
// formatter: function() {
// // console.log('===', this);
// return `<div>${this.point.name}</div><br/><div>${this.y}, ${this.percentage.toFixed(1)}%</div>`
// },
format: "<b>{point.name}</b><br/> {point.y}处, {point.percentage:.1f} %",
style: {
// fontSize: 16,
},
},
},
},
colors: [
"#61D2C3",
"#F2657D",
"#8B83EB",
"#f8d135",
"#51BAFC",
"#ED8F5B",
"#4782E6",
"#ff3c2a",
"#5adb62",
"#9504fc",
"#f29df5",
"#faf8f8",
],
series: [
{
name: "",
type: "pie",
// colorByPoint: true,
data: statisticsArr,
},
],
});

​饼图示例​