Skip to content

Commit 0c43709

Browse files
committed
grunt打包压缩
1 parent 632e0e8 commit 0c43709

File tree

8 files changed

+1472
-3
lines changed

8 files changed

+1472
-3
lines changed

Gruntfile.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = function(grunt){
2+
grunt.initConfig({
3+
pkg : grunt.file.readJSON('package.json'),
4+
concat : {
5+
'dist/JChart.debug.js' :
6+
['src/JChart.js','src/*.js']
7+
},
8+
uglify : {
9+
target : {
10+
files : {
11+
'dist/JChart.min.js': 'dist/JChart.debug.js'
12+
}
13+
}
14+
}
15+
16+
});
17+
grunt.loadNpmTasks('grunt-contrib-concat');
18+
grunt.loadNpmTasks('grunt-contrib-uglify');
19+
20+
grunt.registerTask('default', ['concat','uglify']);
21+
}

JChart.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "Jingle Chart",
3+
"title": "Html5 Mobile Chart",
4+
"description": "移动端canvas图表,想做最简单的图表",
5+
"version": "0.1.0",
6+
"homepage": "https://github.com/shixy/JChart",
7+
"author": {
8+
"name": "walker",
9+
"email": "[email protected]"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "git://github.com/shixy/JChart.git"
14+
},
15+
"bugs": {
16+
"url": "https://github.com/shixy/JChart/issues"
17+
},
18+
"licenses": [
19+
{
20+
"type": "MIT",
21+
"url": "https://github.com/shixy/Jingle/blob/master/LICENSE-MIT"
22+
}
23+
],
24+
"keywords": []
25+
}

demo/bar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<canvas id="canvas1" height="200" width="600"></canvas>
1414
<script type="text/javascript">
1515
var data = {
16-
labels : ["一月","二月","三月","四月","五月","六月","七月",'八月','9月','10月','11月','12月','9月','10月','11月','12月','9月','10月','11月','12月','9月','10月','11月','12月','9月','10月','11月','12月'],
16+
labels : ["2012","二月","三月","四月","五月","六月","七月",'八月','九月','十月','十一月','十二月','2013',"二月","三月","四月","五月","六月","七月",'八月','九月','十月','十一月','十二月','2014','一月','二月'],
1717
datasets : [
1818
{
1919
fillColor : "rgba(220,220,220,0.5)",

demo/line.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
var line = new JChart.Line(data,{
3535
id : 'canvas1'
3636
});
37-
line.on('tap',function(data,i,j){
37+
line.on('tap.point',function(data,i,j){
3838
alert(JSON.stringify(data));
3939
});
4040

demo/pie.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@
2929
var p1 = new JChart.Pie(pieData,{
3030
id : 'canvas1'
3131
});
32-
p1.on('click',function(i,data){
32+
p1.on('tap.pie',function(i,data){
3333
console.log('点击了第'+i+'个扇形');
3434
return true;
3535
})
36+
p1.on('doubleTap.pie',function(i,data){
37+
console.log('双击了第'+i+'个扇形');
38+
return true;
39+
})
3640
p1.on('animationComplete',function(){
3741
console.log('动画执行完毕');
3842
})

0 commit comments

Comments
 (0)