/
demo4.html
112 lines (106 loc) · 2.16 KB
/
demo4.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!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;
}
#demo1 .ks-charts-legend{
}
#demo1 .ks-charts-legend ul li{
float: left;
padding: 10px;
}
#demo1 .ks-charts-legend .disable{
color:#ccc;
}
#demo1 .ks-charts-legend .legend-text{
padding-left: 5px;
}
</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",
barsRatio:0.9,
type: 'column',
themeCls:"ks-chart-rainbow",
title:{
content:"HELLO WORLD",
css:{
}
},
anim:{
},
subTitle:{
content:"hello world",
css:{
}
},
yAxis: {
text:[2,4,6,8,10,12,14,16,18,20,22,24,26]
},
xAxis:{
text:['']
},
bars:{
},
series:[
{data:[8],text:"H"},
{data:[5],text:"E"},
{data:[12],text:"L"},
{data:[12],text:"L"},
{data:[16],text:"O"},
{data:[24],text:"W"},
{data:[16],text:"O"},
{data:[19],text:"R"},
{data:[12],text:"L"},
{data:[4],text:"D"}
],
yLabels:{
template:function(i,text){
return "<span style='color:#666;padding-right:10px;white-space:nowrap'><span style='font-weight:bold'>No.</span> "+parseInt(text)+"</span>";
}
},
tip:{
template:"<span>No. {{y}}</span> <br/><h2 style='font-size:30px'>{{text}}</h2>",
alignX:"right",
css:{"border-color":"{COLOR}"},
offset:{
y:-10,
x:-10
}
},
legend:{
isShow:true,
css:{
marginLeft:150,
marginTop:260
}
}
});
});
})(KISSY);
</script>
</body>
</html>