How do I vertically align label in google chart say on y or r axis?
Yes, vertical Align is possible now.
You can do them by
var options = {
title: "Test",
hAxis: {
direction:-1,
slantedText:true,
slantedTextAngle:90 // here you can even use 180
}
};
I am adding full codes for testing
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChartModeldaily);
function drawChartModeldaily() {
var data = google.visualization.arrayToDataTable(
[
['daily', 'Views', 'Likes'],
['Tue', 4, 19],
['Mon', 22, 16],
['Sat', 3, 1],
['Fri', 15, 34],
['Thu', 27, 44],
['Wed', 17, 23],
]
);
var options = {
title: "Test",
hAxis: {
direction:-1,
slantedText:true,
slantedTextAngle:90
}
};
var chart = new google.visualization.LineChart(document.getElementById("chart_div_daily"));
chart.draw(data, options);
}
</script>
<div id="chart_div_daily" style="width: 900px; height: 500px;"></div>
I am working with latest Google Chart. Please check them at https://developers.google.com/chart/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With