$(document).ready(function() {
var chart = {
plotBackgroundColor: null,
plotBorderWidth: 0,
plotShadow: false
};
var title = {
text: '前端开发语言',
align: 'center',
verticalAlign: 'middle',
y: 70
};
var tooltip = {
pointFormat: '{series.name}: {point.percentage:.1f}%'
};
var plotOptions = {
pie: {
dataLabels: {
enabled: true,
distance: -50,
style: {
fontWeight: 'bold',
color: 'white',
textShadow: '0px 1px 2px black'
}
},
startAngle: -90,
endAngle: 90,
center: ['50%', '75%']
}
};
var series= [{
type: 'pie',
name: 'Browser share',
innerSize: '50%',
data: [
['vue3', 45],
['html', 26],
['css3', 12],
['node', 8],
['php', 7]
]
}];
var json = {};
json.chart = chart;
json.title = title;
json.tooltip = tooltip;
json.series = series;
json.plotOptions = plotOptions;
$('#myChart').highcharts(json);
});
点击运行 》