thefiercepilot Posted December 4, 2017 Report Share Posted December 4, 2017 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.