在IE 7/8中将Flot升级到8.1图形无法渲染

时间:2013-08-16 18:37:09

标签: javascript jquery internet-explorer-8 flot

我将我的代码删除到包含flog插件和jquery文件的简单页面,但我仍然无法在IE 7和8中获取flot图形。我可能会遗漏一些内容,但我使用的是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

1 个答案:

答案 0 :(得分:1)

抱歉慢慢回来。显然,我所拥有的excanvas的下载版本与Flot附带的版本有所不同。一旦我将它们切换出来,IE 7/8中的一切都运行良好。