Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $http.get(API).then(function(response) {
- var i;
- for (i = 0; i < response.data.length; i++) {
- datoAux.push(response.data[i].film);
- datoAux2.push(response.data[i].money);
- }
- console.log(datoAux);
- console.log(datoAux2);
- Highcharts.chart('container', {
- chart: {
- type: 'bar'
- },
- title: {
- text: "Takings stats in Spain at 2017"
- },
- xAxis: {
- categories: [datoAux[0],datoAux[1],datoAux[2],datoAux[3],datoAux[4]],
- title: {
- text: null
- }
- },
- yAxis: {
- min: 0,
- title: {
- text: 'Money (millions)',
- align: 'high'
- },
- labels: {
- overflow: 'justify'
- }
- },
- tooltip: {
- valueSuffix: ' millions'
- },
- plotOptions: {
- bar: {
- dataLabels: {
- enabled: true
- }
- }
- },
- legend: {
- layout: 'vertical',
- align: 'right',
- verticalAlign: 'top',
- x: -40,
- y: 80,
- floating: true,
- borderWidth: 1,
- backgroundColor: ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'),
- shadow: true
- },
- credits: {
- enabled: false
- },
- series: [{
- name: 'Year 2017',
- data: [datoAux2[0],datoAux2[1],datoAux2[2],datoAux2[3],datoAux2[4]]
- }]
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement