HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <script src="https://www.gstatic.com/charts/loader.js"></script> </head> <body> <div id="point"> </div> <script> google.charts.load('current', {packages: ['corechart', 'bar']}); google.charts.setOnLoadCallback(drawBasic); function drawBasic() { var data = google.visualization.arrayToDataTable([ ['Programming Language', 'Users', { role: 'style' }, { role: 'annotation' }], ['javascript', 350,'red', 'javascript'], ['python', 220, 'green', 'python'], ['java', 180, 'blue', 'java'], ['php', 160, 'black', 'php'], ['c', 90, 'orange', 'c'] ]); var options = { title: 'Top 5 Programming Language 2019', chartArea: {width: '50%', height:'75%'}, height: 350, hAxis: { title: 'Total Users', minValue: 0 }, vAxis: { title: 'Programming Language' }, legend: { position: 'none' } }; var chart = new google.visualization.BarChart(document.getElementById('point')); chart.draw(data, options); } </script> </body> </html>
OUTPUT
×

Save as Private