开发者

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

开发者 https://www.devze.com 2023-04-04 05:07 出处:网络
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

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/tTqj开发者_如何学JAVAr/


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.


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!


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>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号