Skip to content

Commit ceb400b

Browse files
author
hongxun.lhx
committed
add pie chart
1 parent 31a4627 commit ceb400b

13 files changed

Lines changed: 3723 additions & 3 deletions

File tree

‎Gruntfile.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ module.exports = function(grunt) {
7474
src: [
7575
'js/swiper-init.js',
7676
'js/swiper.js',
77-
'js/photo-browser.js'
77+
'js/photo-browser.js',
78+
'js/chart.js',
79+
'js/chart-wrap.js'
7880
],
7981
dest: '<%= meta.distPath %>js/<%= pkg.name %>-extend.js'
8082
}

‎_site/assets/js/docs.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎_site/demos/index.html‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ <h1 class="title">SUI Mobile</h1>
151151
</div>
152152
</a>
153153
</li>
154+
<li>
155+
<a href="/demos/pie" class="item-link item-content" data-transition="slide-in">
156+
<div class="item-inner">
157+
<div class="item-title">图表</div>
158+
</div>
159+
</a>
160+
</li>
154161
</ul>
155162
</div>
156163
</div>

‎_site/demos/pie/index.html‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<title>SUI Mobile Demo</title>
7+
<meta name="description" content="Ratchet: Build mobile apps with simple HTML, CSS, and JS components.">
8+
<meta name="author" content="Connor Sears">
9+
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
10+
<link rel="shortcut icon" href="/favicon.ico">
11+
<meta name="apple-mobile-web-app-capable" content="yes">
12+
<meta name="apple-mobile-web-app-status-bar-style" content="black">
13+
14+
<!-- Google Web Fonts -->
15+
16+
<link rel="stylesheet" href="/dist/css/sm.css">
17+
<link rel="stylesheet" href="/dist/css/sm-extend.css">
18+
<link rel="stylesheet" href="/assets/css/demos.css">
19+
20+
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/assets/img/apple-touch-icon-114x114.png">
21+
<script src="/assets/js/zepto.js"></script>
22+
<script>
23+
//ga
24+
</script>
25+
</head>
26+
<body>
27+
<header class="bar bar-nav">
28+
<a class="button button-link button-nav pull-left" href="/demos" data-transition='slide-out'>
29+
<span class="icon icon-left"></span>
30+
返回
31+
</a>
32+
<h1 class="title">饼图</h1>
33+
</header>
34+
<div class="content">
35+
<div class="content-padded">
36+
<canvas id='pie1' data-toggle='pie'
37+
data-json='[
38+
{
39+
"value": 300,
40+
"color":"#F7464A",
41+
"highlight": "#FF5A5E",
42+
"label": "Red"
43+
},
44+
{
45+
"value": 50,
46+
"color": "#46BFBD",
47+
"highlight": "#5AD3D1",
48+
"label": "Green"
49+
},
50+
{
51+
"value": 100,
52+
"color": "#FDB45C",
53+
"highlight": "#FFC870",
54+
"label": "Yellow"
55+
}
56+
]'
57+
></canvas>
58+
<canvas data-toggle='pie' id='pie2' data-url='/json/pie-chart.json'></canvas>
59+
</div>
60+
</div>
61+
62+
<script src="/dist/js/sm.js"></script>
63+
<script src="/dist/js/sm-extend.js"></script>
64+
<script src="/assets/js/demos.js"></script>
65+
</body>
66+
</html>

‎_site/json/pie-chart.json‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"data": [
3+
{
4+
"value": 200,
5+
"label": "Red"
6+
},
7+
{
8+
"value": 150,
9+
"label": "Green"
10+
},
11+
{
12+
"value": 100,
13+
"label": "Yellow"
14+
}
15+
]
16+
}

0 commit comments

Comments
 (0)