javascript - Google Charts: How to create tables with grouped columns names? -


i'm trying create table google charts data in column names placed in higher-level column name readability.

in example, move "group 1" , "group 2" 'higher' level; left table end right table.

enter image description here

i've read through documentation , haven't found reference this. possible? if yes, approach? thanks.

what (uses jquery), can modify own custom needs:

https://jsfiddle.net/7tq6sdwc/

 google.setonloadcallback(drawtable);    function drawtable() {     var data = new google.visualization.datatable();     data.addcolumn('string', 'name');     data.addcolumn('number', 'salary');     data.addcolumn('boolean', 'full time employee');     data.addrows([       ['mike',  {v: 10000, f: '$10,000'}, true],       ['jim',   {v:8000,   f: '$8,000'},  false],       ['alice', {v: 12500, f: '$12,500'}, true],       ['bob',   {v: 7000,  f: '$7,000'},  true]     ]);      var table = new google.visualization.table(document.getelementbyid('table_div'));      table.draw(data, {showrownumber: true, width: '100%', height: '100%'});       var tablehead ='<tr class="google-visualization-table-tr-head"><th class="google-visualization-table-th gradient unsorted" colspan="4">my header</th></tr';       var stuff = jquery('#table_div').find('thead').prepend(tablehead);    } 

result:

enter image description here


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 -