Multiple column charts with different row numbers

17 views
Skip to first unread message

Joshua Grant

unread,
Jan 20, 2016, 5:14:09 PM1/20/16
to Google Visualization API
Hi,

I've been putting together a presentation which has a number of different charts (pie, bar, column) all pulling data from the same data table (which I query). I've defined a different view for each chart, specifying the columns with the data for that specific chart. This works fine except that one of my column charts has 20 entries on the horizontal axis (rows from the data table) and the others have 2-8. Unfortunately ALL the column charts are formatted as if they're expecting 20 entries on the horizontal axis. So the charts with only four values are squished to the left-hand side with a bunch of white space for entries that don't exist. Is there a way to make each chart independent, or dependent (in terms of auto-axis format) on only the columns of data that are actually plotted? Here are two images in case my description wasn't clear.

Thanks for any help you can offer.




Joshua Grant

unread,
Jan 21, 2016, 6:39:37 AM1/21/16
to Google Visualization API
Solved.

var view7 = new google.visualization.DataView(data);   
    view7.setColumns([37, 38, 39, 40]), view7.setRows([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);

Josh
Reply all
Reply to author
Forward
0 new messages