--- a/cms/app-client/app/components/visu-langues.js Thu Dec 10 17:04:51 2015 +0100
+++ b/cms/app-client/app/components/visu-langues.js Fri Dec 11 13:13:47 2015 +0100
@@ -2,6 +2,8 @@
export default Ember.Component.extend({
didInsertElement: function(){
+ var _this = this;
+
var data = google.visualization.arrayToDataTable([
['Location', 'Parent', 'Market trade volume (size)', 'Market increase/decrease (color)'],
['Global', null, 0, 0],
@@ -50,10 +52,6 @@
['Bwatoo (bwa)', 'Nouvelle-Calédonie', 4, 4]
]);
-
-
-
-
var tree = new google.visualization.TreeMap(document.getElementById('chart_div'));
tree.draw(data, {
@@ -64,5 +62,13 @@
fontColor: 'black',
showScale: true
});
+
+ function selectHandler (){
+ console.log(data.getValue(tree.getSelection()[0].row, 0));
+ _this.sendAction('action', data.getValue(tree.getSelection()[0].row, 0));
+ }
+
+ google.visualization.events.addListener(tree, 'select', selectHandler);
+
}
});