未捕获的异常无效的情节flot

San*_*aji 5 flot

我使用以下方法在studentchart div中使用flot绘制折线图:

$.plot(jQuery("#studentavgchart"), DATA, options);  
Run Code Online (Sandbox Code Playgroud)

图形将使用class OneTwo绘制在div之外.如果我可以删除div studentchart的样式,则会显示javascript错误.我需要在父div中绘制图形,即; 在一个

<div class="oneTwo">
    <div class="widget" >
        <div class="header">
            <span>
                <span class="ico gray info2"></span>Total Class No
            </span>
        </div>
        <div class="content">
            <div id="studentchart" style="width:100%;height:300px;"></div>
        </div>
    </div>
</div> 
Run Code Online (Sandbox Code Playgroud)

小智 19

我看到你的情节函数调用是使用"studentavgchart"而你的div的id是"studentchart"

我也遇到了这个问题,发现我的Plot div需要一个指定高度的样式或类.以像素或%为单位.

希望有所帮助.