Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A negative value for svg attribute <width> is not allowed

I am trying to draw two google treemaps and keep them in tabs and am getting the error:

A negative value for svg attribute <width> is not allowed

Only one of the treemaps is visible. I am assuming the other one is not able to finish drawing. There is no other description of the error in the console. (Google chrome).

My code: http://jsfiddle.net/tTqjr/

like image 767
jay Avatar asked Sep 13 '11 02:09

jay


3 Answers

Solved the problem. The div element on which Google Annotated timeline was being created had display:none property. Just made sure that display:none is changed to display:block before calling the draw function.

like image 118
jay Avatar answered Nov 16 '22 22:11

jay


Appreciate this wasn't the OP's issue, but I had the same error, and setting display: block; didn't make any difference for me, but I had padding-top: 50px; on the div for the chart, and removing that resolved the issue for me!

like image 23
DarthPablo Avatar answered Nov 16 '22 22:11

DarthPablo


I wrapped my two divs in a boostrap row/col pair to solve and togglke them with hide()/show()/toggle() buttons.

From

<div class="row">
    <div class="col-md-12" id="chart_div">
    </div>
</div>
<div class="row">
    <div class="col-md-12" id="chart_div2">
    </div>
</div>

to:

<div class="row">
    <div class="col-md-12">
        <div id="chart_div">
        </div>
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        <div id="chart_div2">
        </div>
    </div>
</div>
like image 2
Steve Grove Avatar answered Nov 17 '22 00:11

Steve Grove