I try to create bar chart using google chart example
var data = new google.visualization.DataTable();
data.addColumn(\'string\', \'Topping\');
d
Set the tick
values:
vAxis: {
ticks: [{v:0, f:'0%'},{v:10, f:'10%'},{v:20, f:'20%'},{v:30, f:'30%'}]
}
u can set x axis by modifing count value as we are using DataTable()
var databmi = new google.visualization.DataTable();
data.addColumn('string', 'Country');
data.addColumn('number', 'GDP');
data.addRows([
['US', 16768100],
['China', 9181204],
['Japan', 4898532],
['Germany', 3730261],
['France', 2678455]
]);
var options = {
title: 'GDP of selected countries, in US $millions',
width: 500,
height: 300,
legend: 'none',
bar: {groupWidth: '95%'},
vAxis: {
title :'your choice',
gridlines: { count: 4 }
},
hAxis: {
title :'your choice',
gridlines: {count: 4}
}
};
You can force the x-axis of a BarChart to always show a certain range by setting the hAxis.viewWindow.min
and hAxis.viewWindow.max
options:
hAxis: {
viewWindow: {
min: 0,
max: 100
},
ticks: [0, 25, 50, 75, 100] // display labels every 25
}