<div id="chart" style="width:1000px; height:550px;"></div> <script> google.charts.load('current', {packages: ['corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.arrayToDataTable(<?php echo $chartData; ?>); var options = { title: 'Sales By Year', hAxis: {title: 'Year', titleTextStyle: {color: '#333'}}, vAxis: {minValue: 0}, bars: 'vertical', colors: ['#1b9e77'], }; var chart = new google.visualization.ColumnChart(document.getElementById('chart')); chart.draw(data, options); } </script>