Dojo chart not working in Firefox, Explorer

对着背影说爱祢 提交于 2019-12-11 17:30:57

问题


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>

回答1:


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



来源:https://stackoverflow.com/questions/48244178/dojo-chart-not-working-in-firefox-explorer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!