1

我试图将我的页面(带有一些谷歌图表)导出为带有可爱PDF扩展名的pdf,它适用于chrome和ie9,但在ie8中图表不可见,而是空白。

任何想法?

例子:

JSFIDDLE

如果有人需要它来做一些测试,这里是一个带有工作图表的 jsfiddle 的链接

代码

<div id="visualization"></div>

google.load('visualization', '1', {packages: ['corechart']});

function drawVisualization() {
    // Create and populate the data table.
    var data = google.visualization.arrayToDataTable([
        ['Year', 'Austria', 'Belgium', 'Czech Republic', 'Finland', 'France', 'Germany'],
        ['2003',  1336060,   3817614,       974066,       1104797,   6651824,  15727003],
        ['2004',  1538156,   3968305,       928875,       1151983,   5940129,  17356071],
        ['2005',  1576579,   4063225,       1063414,      1156441,   5714009,  16716049],
        ['2006',  1600652,   4604684,       940478,       1167979,   6190532,  18542843],
        ['2007',  1968113,   4013653,       1037079,      1207029,   6420270,  19564053],
        ['2008',  1901067,   6792087,       1037327,      1284795,   6240921,  19830493]
    ]);

    // Create and draw the visualization.
    new google.visualization.ColumnChart(document.getElementById('visualization')).
    draw(data, {
        title:"Yearly Coffee Consumption by Country",
        width:600, height:400,
        hAxis: {
            title: "Year"
        }
    });
}

google.setOnLoadCallback(drawVisualization);

谢谢

4

1 回答 1

0

我相信这是 IE8 打印 VML 的错误。最简单的解决方案是强制页面进入 IE7 兼容模式。

有关更多详细信息和其他解决方案,请参阅http://www.mattesch.info/blog/printing-vml-and-other-printing-bugs-with-ie8/

于 2013-10-09T19:48:48.377 回答