0

我正在尝试使用Flot JavaScript 绘图库(版本 0.8.2)和excanvas.js使其适应 IE8。

调用$.plot(plotPlaceholder, data, options);我得到 JS 错误'fillStyle' is null or not an object on excanvas.js, line 230, character 5,对应一个片段:

function copyState(o1, o2) {
    o2.fillStyle = o1.fillStyle;
    ...
}

这是我的 index.html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<head>
<!--[if IE]><script type="text/javascript" src="excanvas.js"></script><![endif]-->
<script src="jquery-1.9.1.js" type="text/javascript" ></script>
<script src="jquery.flot.js" type="text/javascript" ></script>
<script>
    $(document).ready(function() {
        data = []
        data.push({data: [[63.62, 16.93]], label: 0, color: "red"});
        data.push({data: [[56.1, 13.11]], label: 1, color: "blue"});
        data.push({data: [[30, 13]], label: 2, color: "green"});

        var options = {};
        plotPlaceholder = ".results-container";
        var plot = $.plot(plotPlaceholder, data, options);
    });
</script>
</head>
    <body>
        <div class="plot-container">
            <div class="results-container" style="width: 600px; height: 300px; margin:auto;"></div>
        </div>
    </div>
</body>
4

0 回答 0