jay
jay

Reputation: 2077

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/

Upvotes: 7

Views: 14649

Answers (3)

jay
jay

Reputation: 2077

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.

Upvotes: 11

Steve Grove
Steve Grove

Reputation: 933

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>

Upvotes: 2

DarthPablo
DarthPablo

Reputation: 156

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!

Upvotes: 2

Related Questions