javascript - Google Charts API: more than one label rows on x axis? -


i have chart bar chart showing multiple data. data divided year (2014, 2015) , quarter (q1,q2,q3,q4). can show either quarters on x-axis or year, not both. made screenshot , put years in there show i'd achieve.

<html>  <head>   <script type="text/javascript" src="https://www.google.com/jsapi"></script>  </head>  <body>   <script type="text/javascript">    google.load('visualization', '1.1', {packages: ['bar']});    google.setonloadcallback(drawbasic);    function drawbasic() {    //create data table object   var data = google.visualization.arraytodatatable([       ['','sales', 'expenses'],       ['q1',1000, 400],       ['q2',1000, 400],       ['q3',1170, 460],       ['q4',900, 500],       ['q1',1400, 420],       ['q2',1240, 750],       ['q3',1001, 360],       ['q4',788, 800]     ]);   var options = {     width: 800, height: 600, is3d: false, title: 'company earnings'   };   var chart = new google.charts.bar(     document.getelementbyid('chart_div'));   chart.draw(data, google.charts.bar.convertoptions(options)); }  </script>  <div id="chart_div"></div> </body> </html> 

here result (i added years in paint):

enter image description here

any ideas how this?

i remembered seeing following post sometime lets add multiple x-axis details. perhaps help:

http://www.lornajane.net/posts/2011/adding-multiple-axis-labels-to-a-google-chart


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -