How to change google bar chart data labels position ? I would like to have data labels (2003,2004,...) between the bars - not straight below them as it is now.enter image description here
function drawVisualization() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['Year', 'Austria', 'Bulgaria', 'Denmark', 'Greece'],
['2003', 1336060, 400361, 1001582, 997974],
['2004', 1538156, 366849, 1119450, 941795],
['2005', 1576579, 440514, 993360, 930593],
['2006', 1600652, 434552, 1004163, 897127],
['2007', 1968113, 393032, 979198, 1080887],
['2008', 1901067, 517206, 916965, 1056036]
]);
// Create and draw the visualization.
new google.visualization.ColumnChart(document.getElementById('chart')).
draw(data,
{title:"Yearly Coffee Consumption by Country",
width:600, height:400,
vAxis: {title: "Year"}, isStacked: true,
hAxis: {title: "Cups"}}
);
}
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawVisualization);
Here are some options...
I've added
null
rows to space the data and moved the labels to thenull
rows.This causes the labels to appear on a second line.
I thought
maxAlternation
might correct the issue but only slants the text.CHART_1 looks the best to me...