Current example first; the original chart examples below are retained and cleaned up for continued learning.
April 100 April 200 April 300 April 400
JavaScript
<scripttype="text/javascript"src="https://www.gstatic.com/charts/loader.js"></script>
<scripttype="text/javascript">
var my_2d = [["Jan","300","150"],["Feb","200","200"],["March","100","200"],["April","200","300"],["May","200","300"],["Jun","100","100"],["July","200","150"]]
// Load the Visualization API and the corechart package.
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Month');
data.addColumn('number', 'Tutorials');
data.addColumn('number', 'hits');
for(i = 0; i < my_2d.length; i++)
data.addRow([my_2d[i][0], parseInt(my_2d[i][1]),parseInt(my_2d[i][2])]);
var options = {
title: 'plus2net.com tutorial Hits',
hAxis: {title: 'Month', titleTextStyle: {color: '#333'}},
vAxis: {minValue: 0}
};
var chart = new google.visualization.AreaChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
///////////////////////////////
function re_draw(nos){
my_2d[3][2]=nos;
drawChart();
}
////////////////////////////////////
</script>
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery,
and web development at plus2net. The tutorials focus on clear explanations, working
examples, and code that readers can test and adapt while learning.