Skip to content

Commit f8abbe1

Browse files
committed
新增文件
0 parents  commit f8abbe1

File tree

6 files changed

+599
-0
lines changed

6 files changed

+599
-0
lines changed

chart-3d.png

83.8 KB
Loading

highcharts.html

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>月消费饼状图</title>
6+
<script src="js/jquery.min.js"></script>
7+
<script src="js/highcharts.js"></script>
8+
<script src="js/highcharts-3d.js"></script>
9+
<script src="js/exporting.js"></script>
10+
<style>
11+
#pie{
12+
width:500px;
13+
height:500px;
14+
}
15+
</style>
16+
</head>
17+
<body>
18+
<div id="pie"></div>
19+
<script>
20+
// 875.2
21+
$('#pie').highcharts({
22+
title:{
23+
text:'月消费饼状图'
24+
},
25+
chart:{
26+
type:'pie',// 定义图标类型为饼状图
27+
options3d:{// 设置3d信息
28+
enabled:true,
29+
alpha:30,//围绕x轴旋转的度数
30+
beta:0//围绕y轴旋转的度数
31+
}
32+
},
33+
series:[{
34+
type:'pie',
35+
name:'花费',
36+
data:[
37+
{
38+
name: '饮食',
39+
y:24,
40+
sliced: true,//默认选中
41+
selected: true//设置点其他的时候,合拢
42+
},
43+
['生活日用',24],
44+
['交通出行',15],
45+
['通讯物流',1],
46+
['文教娱乐',10],
47+
['人情往来',15],
48+
['其他',11]
49+
]
50+
}],
51+
tooltip: {
52+
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
53+
},
54+
plotOptions:{
55+
pie:{
56+
allowPointSelect: true,//是否允许选择
57+
cursor:'pointer',
58+
depth:35,//3d视图的深度
59+
dataLabels: {
60+
enabled: true,
61+
format: '<b>{point.name}</b>: {point.percentage:.1f} %'
62+
}
63+
}
64+
},
65+
credits:{
66+
text:"author:puff",
67+
href:"https://github.com/puffing/highcharts02",
68+
style:{
69+
color:'green',
70+
fontWeight:'bold',
71+
fontSize:'14px'
72+
},
73+
position:{
74+
y:-20
75+
}
76+
77+
}
78+
})
79+
</script>
80+
</body>
81+
</html>

js/exporting.js

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)