/
demo3.html
88 lines (84 loc) · 1.73 KB
/
demo3.html
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
87
88
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>A Simple Barchart</title>
<link rel="stylesheet" href="http://a.tbcdn.cn/p/global/1.0/global-min.css" />
<style type="text/css">
#demo1{
width:750px;
height:300px;
margin:0px auto;
}
</style>
</head>
<body>
<div id="demo1"></div>
<script src="http://a.tbcdn.cn/s/kissy/1.3.0/kissy-min.js"></script>
<script>
(function(S){
S.config({
combine:true,
packages:[
{
name:"gallery",
path:"http://a.tbcdn.cn/s/kissy/",
charset:"utf-8"
}
]
});
S.use('gallery/kcharts/1.1/barchart/index',function(S,BarChart){
var barChart = new BarChart({
renderTo:"#demo1",
legend:{
isShow:true
},
canvasAttr:{
x:60,
y:60,
width:650,
height:220
},
zoomType:"y",
title:{
content:"Stacked bar chart",
css:{
}
},
anim:{},
stackable:true,
yAxis: {
text:['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
},
xAxis:{
min:0
},
bars:{
css:{
"border":"1px solid #fff"
}
},
series:[{
text: 'John',
data: [5, 3, 4, 7, 2]
}, {
text: 'Jane',
data: [2, 2, 3, 2, 1]
}, {
text: 'Joe',
data: [3, 4, 4, 2, 5]
}],
tip:{
template:"{{text}} {{y}} mm",
alignX:"right",
css:{"border-color":"{COLOR}"},
offset:{
y:-10
}
}
});
});
})(KISSY);
</script>
</body>
</html>