Last active
November 16, 2018 17:36
-
-
Save tchan/29454f72774bb45efb331483dd9e93c9 to your computer and use it in GitHub Desktop.
ChartJS update test
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({ | |
appName: 'ChartJS Update Test', | |
testData: Ember.computed(function() { | |
return { | |
labels: ['hi', 'there', 'sir'], | |
datasets: [{ | |
data: [1,2,3] | |
}] | |
}; | |
}), | |
options: { | |
responsive: false, | |
legend: { display: false, }, | |
}, | |
actions: { | |
addData() { | |
var cdata = this.get('testData'); | |
console.log('cdata', cdata); | |
cdata.datasets[0].data[2] = 5; | |
cdata.labels[2] = "New sir"; | |
this.set('testData',cdata); | |
this.notifyPropertyChange('testData'); | |
} | |
} | |
}); |
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.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment