I am looking to display all the hAxis labels in my chart. Due to the extensive length of the code exceeding 4000 lines, I will only include what I consider to be crucial:
var data = new google.visualization.DataTable();
data.addColumn('string', 'Sample');
data.addColumn('number', 'Elevation');
for (var i = 0; i < results.length; i++) {
if(i%10==0)
{
data.addRow(['' + i / 10 + '', elevations[i].elevation]);
}
else
{
data.addRow([null, elevations[i].elevation]);
}
}
document.getElementById('chart_div').style.display = 'block';
chart.draw(data, {
height: 250,
colors: ['#F00'],
legend: 'none',
titleY: 'Elevation (m)',
titleX: 'Distance',
hAxis: {
slantedTextAngle: 90,
showTextEvery: 1,
}
});
The current outcome can be seen here: https://i.sstatic.net/Fq2kz.png
To achieve my desired result, I need the Distance of the hAxis to display numbers from 0 to 7 consecutively, with an appropriate font-size and angle.
Note: I prefer to have no title for every column except multiples of 10. Any solution that omits adding a title to those specific columns would also be acceptable!