-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogress-svg.js
86 lines (82 loc) · 2.09 KB
/
progress-svg.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//投标进度条
//#fb6a01\E0E1E5
function customizeHighcharts(params) {
var defaultParams = {
colors: ['#02bd9a', '#E0E1E5'],
tooltip: {
shadow: false,
animation: false,
hideDelay: 40
},
title: {
align: 'left',
style: {
color: '#000000',
font: 'normal 16px "Microsoft YaHei", "Lucida Sans Unicode", "Myriad Pro", "Hiragino Sans GB", "Heiti SC", Verdana, simsun'
}
},
chart: {
borderRadius: 0,
borderWidth: 0
},
credits: {
enabled: false
}
};
Highcharts.setOptions($.extend(defaultParams, params));
}
function initDistribution(report, hostId, title) {
total = _.reduce(_.pluck(report, 'data'), function (total, d) {
return total + d;
}, 0)
report = _.map(report, function (r) {
percent = (r.data / total * 100).toPrecision(4);
return {
name: r.label,
y: +percent
};
});
$('.' + hostId).highcharts({
chart: {
type: 'pie'
},
title: null,
yAxis: {
title: {
text: 'yaxis'
}
},
plotOptions: {
pie: {
share: false,
center: ['50%', '50%'],
dataLabels: {
enabled: false
},
showInLegend: false
}
},
legend: {
enabled: false,
layout: 'vertical',
align: 'right',
width: 100,
verticalAlign: 'middle',
userHTML: true,
borderColor: 'transparent',
labelFormatter: function () {
return '<div>' + this.name + '</div>';
}
},
tooltip: {
formatter: function () {
return this.key + ':' + this.y + '%';
}
},
series: [{
size: '132%',
innerSize: '145%',
data: report
}]
});
}