2

我将我的代码剥离到一个简单的页面,包括 flog 插件和 jquery 文件,但仍然无法让 flot 图在 IE 7 和 8 中呈现。我可能遗漏了一些东西,但我使用的是 flot 8.1(7.0 工作正常)。

我将它缩减为一个简单的页面,其中包含我认为是必要的脚本。感谢您提供任何帮助!

<!DOCTYPE html>
<html lang="en">

    <head>        

        <meta http-equiv="X-UA-Compatible" content="IE=edge" />        

        <script type='text/javascript' src='js/plugins/jquery/jquery-1.9.1.min.js'></script>
        <script type='text/javascript' src='js/plugins/jquery/jquery-ui-1.10.1.custom.min.js'></script>
        <script type='text/javascript' src='js/plugins/jquery/jquery-migrate-1.1.1.min.js'></script>
        <script type='text/javascript' src='js/plugins/other/excanvas.js'></script>
        <script type='text/javascript' src='js/plugins/flot/jquery.flot.js'></script>    
        <script type='text/javascript' src='js/plugins/flot/jquery.flot.stack.js'></script>    
        <script type='text/javascript' src='js/plugins/flot/jquery.flot.pie.js'></script>
        <script type='text/javascript' src='js/plugins/flot/jquery.flot.resize.js'></script>
</head>
    <body class="smw ssDark">
        <div class="header">
            <div id="chart_activity" style="height:500px;" >
            </div>
        </div>


        <script>
        $("document").ready(function(){
            if($("#chart_activity").length > 0){

        var stuff = [], contacts = [];

        for (var i = 0; i < 7; i += 1) {
            stuff.push([i, parseInt(Math.random() * 30)]);
            contacts.push([i, parseInt(Math.random() * 30)]);
        }

        $.plot($("#chart_activity"), [ { data: stuff, label: "stuff"}, { data: contacts, label: "contacts"}], {xaxis: {show: true}, yaxis: { show: true}});

    }
    });

        </script>
    </body>
</html>

编辑:忘了提,我在 IE 控制台中收到以下错误:

SCRIPT5007: Unable to get property 'fillStyle' of undefined or null reference 
excanvas.js, line 230 character 5
4

1 回答 1

1

很抱歉慢慢回复答案。显然,我下载的 excanvas 版本与 Flot 附带的版本有所不同。一旦我把它们关掉,在 IE 7/8 中一切正常。

于 2013-08-22T16:27:19.433 回答