Jump to content

Flight data charts


thefiercepilot

Recommended Posts

I am trying to make charts for the pilot as well as va no of flights per month. The code I am currently using is-

var chartSales = new Chart(chartSalesContainer, {
                type: 'line',
                data: {
                    labels: ['JAN','FEB','MAR'],
                    datasets: [
                        {
                            label: 'Months',
                            fill: true,
                            backgroundColor: 'rgba(255,193,7,.75)',
                            borderColor: 'rgba(255,193,7,1)',
                            pointBackgroundColor: 'rgba(255,193,7,1)',
                            pointBorderColor: '#fff',
                            pointHoverBackgroundColor: '#fff',
                            pointHoverBorderColor: 'rgba(255,193,7,1)',
                            data: [0,12,13]
                        }
                      ]
                },
                options: {
                    scales: {
                        yAxes: [{
                            ticks: {
                                suggestedMax: 50
                            }
                        }]
                    },
                    tooltips: {
                        callbacks: {
                            label: function(tooltipItems, data) {
                                return ' ' + tooltipItems.yLabel + ' Flights';
                            }
                        }
                    }
                }
            });

How should I change my code so that instead of manually typing data: [0,12,13] and labels: ['JAN','FEB','MAR'] it automatically gets data form the VMS? Can someone provide me with a link to or the code it self.

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...