Skip to content

Commit eb4dea2

Browse files
author
elijah
committed
Merge pull request #96 from apinf/feature/sample-chartUsage-demo
sample chart demo with package added
2 parents c075e9c + 1e6be89 commit eb4dea2

File tree

7 files changed

+60
-1
lines changed

7 files changed

+60
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
.meteor/.id
44
settings.json
55
.idea/
6+
settings.json

.meteor/packages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@ yogiben:admin
5656
timmyg:wow
5757
tsega:skrollr
5858
accounts-github
59+
chart:chart
5960
brylie:api-umbrella
6061
percolate:synced-cron

.meteor/versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ cfs:storage-adapter@0.2.2
4040
cfs:tempstore@0.1.5
4141
cfs:upload-http@0.0.20
4242
cfs:worker@0.1.4
43+
chart:chart@1.0.1-beta.4
4344
check@1.0.5
4445
cmather:handlebars-server@0.2.0
4546
coffeescript@1.0.6
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<template name="chartLayout">
2+
<div class="layout master-layout ">
3+
{{> navbar}}
4+
5+
<div class="sampleChart">
6+
<canvas id="canvasChart"></canvas>
7+
</div>
8+
</div>
9+
<script>
10+
var randomScalingFactor = function(){ return Math.round(Math.random()*100)};
11+
var lineChartData = {
12+
labels : ["January","February","March","April","May","June","July"],
13+
datasets : [
14+
{
15+
label: "My First dataset",
16+
fillColor : "rgba(220,220,220,0.2)",
17+
strokeColor : "rgba(220,220,220,1)",
18+
pointColor : "rgba(220,220,220,1)",
19+
pointStrokeColor : "#fff",
20+
pointHighlightFill : "#fff",
21+
pointHighlightStroke : "rgba(220,220,220,1)",
22+
data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
23+
},
24+
{
25+
label: "My Second dataset",
26+
fillColor : "rgba(151,187,205,0.2)",
27+
strokeColor : "rgba(151,187,205,1)",
28+
pointColor : "rgba(151,187,205,1)",
29+
pointStrokeColor : "#fff",
30+
pointHighlightFill : "#fff",
31+
pointHighlightStroke : "rgba(151,187,205,1)",
32+
data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
33+
}
34+
]
35+
}
36+
window.onload = function(){
37+
var ctx = document.getElementById("canvasChart").getContext("2d");
38+
window.myLine = new Chart(ctx).Line(lineChartData, {
39+
responsive: true
40+
});
41+
}
42+
</script>
43+
</template>

client/style/base.import.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ button.navbar-toggle {
2222

2323
#iron-router-progress.spinner:before {
2424
border-color : darken(@brand-primary,20%);
25-
}
25+
}

client/style/chart.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.sampleChart{
2+
position: absolute;
3+
top:100px;
4+
left:100px;
5+
right:100px;
6+
}
7+
#canvasChart{
8+
height:400px;
9+
}

lib/router/main.coffee

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ Router.map ->
1313
]
1414
data: ->
1515
posts: Posts.find({},{sort: {createdAt: -1}}).fetch()
16+
17+
@route "chart",
18+
path: "/chart"
19+
layoutTemplate: "chartLayout"

0 commit comments

Comments
 (0)