Google Charts - Customized Column Chart
You are Here:
How to Draw a Customized Column Chart?
Please wait google chart is loading...
In this example, we will draw a customized column chart. Please hover the columns in the above chart to view particular details.
Example
HTML Online 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' }],
['javascript', 350,'red'],
['python', 220, 'green'],
['java', 180, 'blue'],
['php', 160, 'black'],
['c', 90, 'orange']
]);
var options = {
title: 'Top 5 Programming Language - 2019',
chartArea: {width: '50%', height: '75%'},
height: 400,
width: 600,
hAxis: {
title: 'Programming Language',
minValue: 0
},
vAxis: {
title: 'Total Users'
},
legend: {
position: 'none'
}
};
var chart = new google.visualization.ColumnChart(document.getElementById('point'));
chart.draw(data, options);
}
</script>
</body>
</html>
More Examples
Example
HTML Online 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' }],
['javascript', 350,'color: red'],
['python', 220, 'color: green; opacity:0.8;'],
['java', 180, 'stroke-color: blue; stroke-width: 4; fill-color: #C5A5CF;'],
['php', 160, 'stroke-color: #871B47; stroke-opacity: 0.6; stroke-width: 8; fill-color: #BC5679; fill-opacity: 0.2;'],
['c', 90, 'color: orange; opacity:0.5;']
]);
var options = {
title: 'Top 5 Programming Language - 2019',
chartArea: {width: '50%', height: '75%'},
height: 400,
width: 600,
hAxis: {
title: 'Programming Language',
minValue: 0
},
vAxis: {
title: 'Total Users'
},
legend: {
position: 'none'
}
};
var chart = new google.visualization.ColumnChart(document.getElementById('point'));
chart.draw(data, options);
}
</script>
</body>
</html>
Reminder
Hi Developers, we almost covered 98% of Google Charts Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in Google Charts.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.