1

使用 highcharts 的源版本,我看到我收到此错误:

highcharts.src.js,第 5099 行字符 4

这是在var VMLRendererExtension块中:

init: function (container, width, height) {
        var renderer = this,
            boxWrapper,
            box;

        renderer.alignedObjects = [];

        boxWrapper = renderer.createElement(DIV);
        box = boxWrapper.element;
        box.style.position = RELATIVE; // for freeform drawing using renderer directly
        container.appendChild(boxWrapper.element);


        // generate the containing box
        renderer.isVML = true;
        renderer.box = box;
        renderer.boxWrapper = boxWrapper;


        renderer.setSize(width, height, false);

        // The only way to make IE6 and IE7 print is to use a global namespace. However,
        // with IE8 the only way to make the dynamic shapes visible in screen and print mode
        // seems to be to add the xmlns attribute and the behaviour style inline.
        if (!doc.namespaces.hcv) {

            doc.namespaces.add('hcv', 'urn:schemas-microsoft-com:vml');

            // setup default css
            doc.createStyleSheet().cssText =
                'hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke' +
                '{ behavior:url(#default#VML); display: inline-block; } ';

        }
    }

错误在doc.createStyleSheet().cssText项目上。不确定它的哪个部分正在死亡。

我们的页面上有两个图表。主要数据图表和跨区域分布数据的图表。如果我只在页面上显示一个或另一个图表(意味着甚至不呈现一个图表),我不会收到此错误。如果两个图表都被渲染,我会得到第一个执行顺序的图表,而不是第二个。我们的图表代码可以在这里找到。请注意,我无法在 jsFiddle 上重现此错误。此错误仅发生在 IE8 中。

我在 HighCharts 论坛上看到了这篇文章。我无法更改文档类型,因为我的代码只是较大站点的一小部分。不显示错误的唯一方法是注释掉他的doc.createStyleSheet().cssText行。我宁愿不只是评论这一点。

现在,这就是它变得丑陋的地方。这只发生在这一页上。如果我们转到显示数据的任何其他页面,我不会收到此错误。那又怎样,你说。好吧,每个页面上的图表构建器代码都是相同的。唯一的区别是系列(类别和值)和图表的高度。我们根据需要多少系列来动态增加图表的高度,以使文本更易于阅读。我已经在这个数据集的分布图中测试了不同数量的类别,这些类别不会引发这个错误。如果我转到其他页面并尝试匹配失败页面上图表的高度,我也无法重现此错误。

4

1 回答 1

0

比较工作页面和非工作页面之间的以下项目:

  • 文档类型
  • 脚本标签
  • 元标记
于 2013-12-09T19:30:53.767 回答