Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. $http.get(API).then(function(response) {
  2. var i;
  3. for (i = 0; i < response.data.length; i++) {
  4. datoAux.push(response.data[i].film);
  5. datoAux2.push(response.data[i].money);
  6. }
  7. console.log(datoAux);
  8. console.log(datoAux2);
  9.  
  10.  
  11. Highcharts.chart('container', {
  12. chart: {
  13. type: 'bar'
  14. },
  15. title: {
  16. text: "Takings stats in Spain at 2017"
  17. },
  18. xAxis: {
  19. categories: [datoAux[0],datoAux[1],datoAux[2],datoAux[3],datoAux[4]],
  20. title: {
  21. text: null
  22. }
  23. },
  24. yAxis: {
  25. min: 0,
  26. title: {
  27. text: 'Money (millions)',
  28. align: 'high'
  29. },
  30. labels: {
  31. overflow: 'justify'
  32. }
  33. },
  34. tooltip: {
  35. valueSuffix: ' millions'
  36. },
  37. plotOptions: {
  38. bar: {
  39. dataLabels: {
  40. enabled: true
  41. }
  42. }
  43. },
  44. legend: {
  45. layout: 'vertical',
  46. align: 'right',
  47. verticalAlign: 'top',
  48. x: -40,
  49. y: 80,
  50. floating: true,
  51. borderWidth: 1,
  52. backgroundColor: ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'),
  53. shadow: true
  54. },
  55. credits: {
  56. enabled: false
  57. },
  58. series: [{
  59. name: 'Year 2017',
  60. data: [datoAux2[0],datoAux2[1],datoAux2[2],datoAux2[3],datoAux2[4]]
  61. }]
  62. });
  63.  
  64. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement