Created
July 26, 2017 21:59
-
-
Save ELepolt/a8ce7d161b0d98c26f1b14b6ed2cf16e to your computer and use it in GitHub Desktop.
ember-cli-chart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
options: { | |
responsive: false | |
}, | |
pieValue1: 300, | |
pieValue2: 50, | |
pieValue3: 100, | |
pieData: Ember.computed('pieValue1', 'pieValue2', 'pieValue3', function(){ | |
return { | |
labels: ['Red', "Green", "Yellow"], | |
datasets: [ | |
{ | |
data: [ | |
parseInt(this.get('pieValue1')), | |
parseInt(this.get('pieValue2')), | |
parseInt(this.get('pieValue3')) | |
], | |
backgroundColor: ["#F7464A", "#46BFBD", "#FDB45C"], | |
hoverBackgroundColor: ["#FF5A5E", "#5AD3D1", "#FFC870"] | |
} | |
] | |
}; | |
}), | |
lineValue1: 65, | |
lineValue2: 59, | |
lineLabel: "July", | |
lineData: Ember.computed('lineValue1', 'lineValue2', 'lineLabel', function(){ | |
var labels = ["January", "February", "March", "April", "May", "June"]; | |
labels.push( this.get('lineLabel') ); | |
return { | |
labels: labels, | |
datasets: [ | |
{ | |
label: "My First dataset", | |
backgroundColor: "rgb(54, 162, 235)", | |
borderColor: "rgb(54, 162, 235)", | |
fill: false, | |
data: [parseInt(this.get('lineValue1')), parseInt(this.get('lineValue2')), 80, 81, 56, 55, 40] | |
}, | |
{ | |
fill: false, | |
label: "My Second dataset", | |
backgroundColor: "rgb(75, 192, 192)", | |
borderColor: "rgb(75, 192, 192)", | |
data: [28, 48, 40, 19, 86, 27, 90] | |
} | |
] | |
}; | |
}), | |
barData: { | |
labels: ["January", "February", "March", "April", "May", "June", "July"], | |
datasets: [ | |
{ | |
label: "My First dataset", | |
fillColor: "rgba(220,220,220,0.5)", | |
strokeColor: "rgba(220,220,220,0.8)", | |
highlightFill: "rgba(220,220,220,0.75)", | |
highlightStroke: "rgba(220,220,220,1)", | |
data: [65, 59, 80, 81, 56, 55, 40] | |
}, | |
{ | |
label: "My Second dataset", | |
fillColor: "rgba(151,187,205,0.5)", | |
strokeColor: "rgba(151,187,205,0.8)", | |
highlightFill: "rgba(151,187,205,0.75)", | |
highlightStroke: "rgba(151,187,205,1)", | |
data: [28, 48, 40, 19, 86, 27, 90] | |
} | |
] | |
}, | |
radarData: { | |
labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"], | |
datasets: [ | |
{ | |
label: "My First dataset", | |
fillColor: "rgba(220,220,220,0.2)", | |
strokeColor: "rgba(220,220,220,1)", | |
pointColor: "rgba(220,220,220,1)", | |
pointStrokeColor: "#fff", | |
pointHighlightFill: "#fff", | |
pointHighlightStroke: "rgba(220,220,220,1)", | |
data: [65, 59, 90, 81, 56, 55, 40] | |
}, | |
{ | |
label: "My Second dataset", | |
fillColor: "rgba(151,187,205,0.2)", | |
strokeColor: "rgba(151,187,205,1)", | |
pointColor: "rgba(151,187,205,1)", | |
pointStrokeColor: "#fff", | |
pointHighlightFill: "#fff", | |
pointHighlightStroke: "rgba(151,187,205,1)", | |
data: [28, 48, 40, 19, 96, 27, 100] | |
} | |
] | |
}, | |
polarAreaData: { | |
datasets: [{ | |
data: [ | |
11, | |
16, | |
7, | |
3, | |
14 | |
], | |
backgroundColor: [ | |
"#FF6384", | |
"#4BC0C0", | |
"#FFCE56", | |
"#E7E9ED", | |
"#36A2EB" | |
], | |
label: 'My dataset' // for legend | |
}], | |
labels: [ | |
"Red", | |
"Green", | |
"Yellow", | |
"Grey", | |
"Blue" | |
] | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.12.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.12.0", | |
"ember-template-compiler": "2.12.0", | |
"ember-testing": "2.12.0" | |
}, | |
"addons": { | |
"ember-data": "2.12.1", | |
"ember-cli-chart": "3.3.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment