I'm trying to create a stacking bar chart with Google Charts. The data is dynamic, so i wont be able to tell the values of the axises until the chart is made. My problem is that the x-axis sometimes fills in unnecessary labels, as shown in the attached screenshot (In this particular scenario i only have 4 sets of data, so the second label named '12' shouldn't really be there).
Any suggestions to how i can fix this, and also align the columns right above their respective labels?
Here's some of the code, as requested. Been trying different variations in the options, without much success.
var data = new google.visualization.DataTable();
data.addColumn('number', 'X');
data.addColumn('number', 'Alfa');
data.addColumn('number', 'Bravo');
data.addColumn('number', 'Charlie');
data.addColumn('number', 'Delta');
data.addColumn('number', 'Echo');
data.addColumn('number', 'Foxtrot');
data.addRows(myDataSet);
var options = {
width: 1000,
height: 563,
series: {
0: { color: '#F7464A' }, //Alfa
1: { color: '#46BFBD' }, //Bravo
2: { color: '#FDB45C' }, //Charlie
3: { color: '#0971B2' }, //Delta
4: { color: '#ab7967' }, //Echo
5: { color: '#a3be8c' } //Foxtrot
},
bar: { groupWidth: '75%' },
isStacked: true,
title: title,
hAxis: {
title: 'Week',
format: '0'
},
vAxis: {
title: 'Tasks'
}
};
var chart = new google.visualization.ColumnChart(
document.getElementById('velocityBarChartDiv'));
chart.draw(data, options);
$("#velocityBarChartDiv").show();