Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. import Ember from 'ember';
  2.  
  3. export default Ember.Component.extend({
  4. tagName: 'div',
  5. classNames: ['chart'],
  6.  
  7. dataChange: function() {
  8. this.rerender();
  9. }.observes('data'),
  10.  
  11. willDestroyElement: function() {
  12. this.$().highcharts().destroy();
  13. },
  14.  
  15. renderChart: function() {
  16. return this.$().highcharts({
  17. title: {
  18. text: 'Monthly Average Temperature',
  19. x: -20 //center
  20. },
  21. subtitle: {
  22. text: 'Source: WorldClimate.com',
  23. x: -20
  24. },
  25. xAxis: {
  26. categories: this.get('xAxisCategories')
  27. },
  28. yAxis: {
  29. title: {
  30. text: 'Temperature (°C)'
  31. },
  32. plotLines: [{
  33. value: 0,
  34. width: 1,
  35. color: '#808080'
  36. }]
  37. },
  38. tooltip: {
  39. valueSuffix: '°C'
  40. },
  41. legend: {
  42. layout: 'vertical',
  43. align: 'right',
  44. verticalAlign: 'middle',
  45. borderWidth: 0
  46. },
  47. series: this.get('seriesData')
  48. })
  49. }.on('didInsertElement')
  50. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement