1、使用Highcharts制作饼图的效果图如下:
2、对应的JavaScript代码---pie-chart.js如下:
$(function () {var chart;var totalMoney=50000$(document).ready(function() {chart = new Highcharts.Chart({chart: {renderTo: 'pie_chart',plotBackgroundColor: 'white',//背景颜色plotBorderWidth: 0,plotShadow: false},title: {text: 'Total:$'+totalMoney,verticalAlign:'bottom',y:-60},tooltip: {//鼠标移动到每个饼图显示的内容pointFormat: '{point.name}: <b>{point.percentage}%</b>',percentageDecimals: 1,formatter: function() {return this.point.name+':$'&#