Use the pie chart of JS drawing
A pie chart splits a circle into multiple slices.
Sample Example: http://www.zhaojz.com.cn/demo/draw8.html
Copy Code code as follows:
Pie chart
Dot Dot Dot
R radius
Data (one-dimensional array)
function Drawpie (dot, r, data) {
if (data && data.length > 0) {
var accumulationangleofslope = new number (0); Cumulative offset angle
var total = new number (0);
var i = 0;
for (; i<data.length;i++) {//Calculate totals for data
Total + = Data[i];
}
for (i = 0;i<data.length;i++) {
var angle = new Number (360*data[i]/total). toFixed (3); Convert Data[i]/total to an angle
Draw a fan
Drawsector (dot, R, new number (angle), new number (Accumulationangleofslope), True, Number (parsefloat (data[i]/total) * ToFixed (3) + '% ');
Accumulationangleofslope = accumulationangleofslope+parsefloat (angle); Cumulative offset angle
}
}
}