Google Chart在IE7中 [英] Google Chart's in IE7

查看:148
本文介绍了Google Chart在IE7中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的可视化库的图表工作正常在Firefox / Chrome中,但是当我在IE7中测试时,我得到了一个不同的字体显示在图表上。不同的电脑产生不同的结果。因此,众所周知,我运行的是IE9,但使用IE7的浏览器模式来测试。



另外,我在Google Charts中使用了新的corepackage,所以它在需要时同时使用VML和SVG,所以它在IE中呈现。但是,无论出于何种原因,我在IE7中都会得到奇怪的字体。



任何人都可以解释可能发生的事情吗? em> Screenshot from Google:
全图
< a图片http://i56.tinypic.com/14aye5s.png



编辑:下面是图表的脚本:

 < script type =text / javascript> 
函数drawChart(){
var data = new google.visualization.DataTable();
data.addColumn('string','Column1');
data.addColumn('number','Column2');
data.addRows(12);

//删除NDA的数据

var chart = new google.visualization.ColumnChart(document.getElementById('Project'));
var formatter = new google.visualization.NumberFormat(
{prefix:'&#163;',
negativeParens:true,
decimalSymbol:'。',
groupingSymbol:','
});
formatter.format(data,0);
formatter.format(data,1);
chart.draw(data,{colors:['#FFC6A5','#FFFF42','#DEF3BD','#00A5C6','#DEBDDE'],width:600,height:300,min: 0,max:0,is3D:false,legend:'bottom',title:'Project Variance',isVertical:true,isStacked:true});} google.setOnLoadCallback(drawChartProjectVariance);< / script>


解决方案

包装单个字体名称,然后用双引号似乎解决了字体问题(虽然它仍然显示为粗体和斜体,似乎没有办法解决)。

例如 -



var options = {'fontName':'Arial'}


I am using the visualization library the charts works fine in Firefox/Chrome, however when I test in IE7 I am getting a different font showing up on the chart. Different computers yield different results.

So it is known, I am running IE9 but using the IE7 "browser mode" to test.

Also, I am using the new "corepackage" in Google Charts, so it utilizes both VML and SVG when needed so it does render in IE. But for whatever reason I get weird fonts in IE7.

Can anyone explain what might be happening?

Screenshot From Google: Full Image Graph http://i56.tinypic.com/14aye5s.png

EDIT: Here is the script for the chart:

<script type="text/javascript">
              function drawChart() {
              var data = new google.visualization.DataTable();
      data.addColumn('string', 'Column1');
data.addColumn('number', 'Column2');
data.addRows(12);

// Removed data for NDA puroses

var chart = new google.visualization.ColumnChart(document.getElementById('Project'));
var formatter = new google.visualization.NumberFormat(
               {prefix: '&#163;',
                negativeParens: true,
                decimalSymbol: '.',
                groupingSymbol: ','
               });
formatter.format(data,0);
formatter.format(data,1);
chart.draw(data, {colors: ['#FFC6A5','#FFFF42','#DEF3BD','#00A5C6','#DEBDDE'], width: 600, height: 300, min: 0, max:0, is3D: false, legend: 'bottom', title: 'Project Variance', isVertical:true, isStacked:true});}google.setOnLoadCallback(drawChartProjectVariance);</script>

解决方案

Wrapping the font name in single, and then double quotes seems to fix the font issue (though it still displays in bold and italic, which there doesn't seem to be a way to fix).

e.g. -

var options = {'fontName' : '"Arial"'}

这篇关于Google Chart在IE7中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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