Dojo图表在Firefox,资源管理器中不起作用 [英] Dojo chart not working in Firefox, Explorer

查看:86
本文介绍了Dojo图表在Firefox,资源管理器中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个脚本,该脚本在选项卡中包含一个dojo图表:图表页面.

如果您使用 Google Chrome 打开图表页面,则该图表可见.如果使用 Firefox Explorer 11 将其打开,则该图表将不可见.

我所有的浏览器都更新到了最新版本.

有人可以告诉我为什么会出现这个错误吗?

这是我的脚本:

<!DOCTYPE html>
<html>
<head>

  <link rel="stylesheet" href="https://js.arcgis.com/3.20/esri/themes/calcite/dijit/calcite.css">
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/dojo/1.12.1/dojo/dojo.js"></script>

  <script>
    require([
             "dojox/charting/Chart",
             "dojox/charting/Chart2D", 
             "dojox/charting/action2d/MoveSlice" , 
             "dojox/charting/action2d/Tooltip",
             "dojo/ready"], 
            function(Chart, Chart2D, MoveSlice, Tooltip, ready){

ready(function(){

var chart1 = new Chart("He");

                chart1.addPlot("default", {
                    type: "Pie",
                    labelOffset: 25,
                    font: "9pt Arial"
                });
                chart1.addSeries("He", [
                    {y: 1, text: 1},
                    {y: 1, text: 2},
                    {y: 1, text: 3}

                ]);
                new Tooltip(chart1, "default");
                new MoveSlice(chart1, "default");

chart1.render();

});

    });

    </script>

</head>
<body class="calcite">
<div>
    <div id="He" style="width: 140px; height: 140px; "></div>
</div>

</body>
</html>

解决方案

我在 https://jsfiddle上重新创建了您的问题.net/1k6w8otn 确实,在Chrome上它运行良好,而在IE11上则显示空白页. IE11控制台报告权限被拒绝,并且调试器在getComputedStyle定义处嗅探到所有异常停止.快速浏览dojo论坛此处显示存在阻止问题 18973 为Dojo 1.12.1打开.

切换到dojo 1.12.2或更高版本,IE11和FF将再次正确显示饼图.请参阅修改后的jsfiddle: https://jsfiddle.net/1k6w8otn/2

I am using a script with a dojo chart inside a tab: chart page.

If you open the chart page with Google Chrome the chart is visible. If you open it with Firefox or Explorer 11 the chart is NOT visible.

All my browsers are updated to their latest versions.

Can somebody tell me why am I getting this error?

This is my script:

<!DOCTYPE html>
<html>
<head>

  <link rel="stylesheet" href="https://js.arcgis.com/3.20/esri/themes/calcite/dijit/calcite.css">
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/dojo/1.12.1/dojo/dojo.js"></script>

  <script>
    require([
             "dojox/charting/Chart",
             "dojox/charting/Chart2D", 
             "dojox/charting/action2d/MoveSlice" , 
             "dojox/charting/action2d/Tooltip",
             "dojo/ready"], 
            function(Chart, Chart2D, MoveSlice, Tooltip, ready){

ready(function(){

var chart1 = new Chart("He");

                chart1.addPlot("default", {
                    type: "Pie",
                    labelOffset: 25,
                    font: "9pt Arial"
                });
                chart1.addSeries("He", [
                    {y: 1, text: 1},
                    {y: 1, text: 2},
                    {y: 1, text: 3}

                ]);
                new Tooltip(chart1, "default");
                new MoveSlice(chart1, "default");

chart1.render();

});

    });

    </script>

</head>
<body class="calcite">
<div>
    <div id="He" style="width: 140px; height: 140px; "></div>
</div>

</body>
</html>

解决方案

I have recreated your issue on https://jsfiddle.net/1k6w8otn Indeed on Chrome it works fine while on IE11 it show blank page. IE11 console however reports Permission denied and debugger sniffing all exception stops at some point at getComputedStyle definition. Quick look on dojo forum here shows that there was blocking issue 18973 opened for Dojo 1.12.1.

Switch to dojo 1.12.2 or newer and IE11 and FF renders pie chart correctly again. See modified jsfiddle: https://jsfiddle.net/1k6w8otn/2

这篇关于Dojo图表在Firefox,资源管理器中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆