How do I get four pie charts to show up side by side?

373 views
Skip to first unread message

David M.M.

unread,
Aug 12, 2013, 5:50:54 PM8/12/13
to google-visua...@googlegroups.com
I have four pie charts, but they all show up one on top of the other. See here: http://mendozaista.tumblr.com/post/58085427197/whos-watching-local-news-not-young-people

I want them all side by side on the same horizontal plane. How can I do this?

Thank You

asgallant

unread,
Aug 12, 2013, 6:11:05 PM8/12/13
to google-visua...@googlegroups.com
You need to use CSS to float the charts' container divs, eg:

in HTML:
<div id="chart_holder">
    <div id="chart_div_1" class="chart_div"></div>
    <div id="chart_div_2" class="chart_div"></div>
    <div id="chart_div_3" class="chart_div"></div>
    <div id="chart_div_4" class="chart_div"></div>
    <div class="clearFloat"></div>
</div>


in CSS:
.chart_div {
    float: left;
}
.clearFloat: {
    clear: both;
}


The charts would line up side-by-side (assuming the chart width is narrow enough to fit 4 in a row; otherwise they will spill over into a new line).

David M.M.

unread,
Aug 12, 2013, 7:48:52 PM8/12/13
to google-visua...@googlegroups.com
So I tried what you wrote and it almost worked. Now it looks like this: http://mendozaista.tumblr.com/post/58085427197/whos-watching-local-news-not-young-people

The first pie chart shows up on the left, but the other three don't. I tried to make the pie charts smaller and bigger, but it's only the first one that keeps showing up. Any ideas?

David M.M.

unread,
Aug 12, 2013, 7:57:22 PM8/12/13
to google-visua...@googlegroups.com
Never mind, I got it to work. I just had to fiddle with the html code. YAY: http://mendozaista.tumblr.com/post/58085427197/whos-watching-local-news-not-young-people

THANKS FOR ALL YOUR HELP!


On Monday, August 12, 2013 3:11:05 PM UTC-7, asgallant wrote:
Reply all
Reply to author
Forward
0 new messages