Google charts vertical alignment plate

How to vertically align a shortcut in google chart on y or r axis?

+4
source share
2 answers

The question has already been asked - Vertical labels with the Google API - but it seems that no, you cannot put vertical labels in charts.

-1
source

Yes, vertical alignment is now possible.

You can do them with

var options = { title: "Test", hAxis: { direction:-1, slantedText:true, slantedTextAngle:90 // here you can even use 180 } }; 

I add complete 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 the latest google chart. Please check them out at https://developers.google.com/chart/

+18
source

All Articles