问题
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
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: '£',
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>
回答1:
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"'}
回答2:
IE7 doesn't support SVG. You can see some alternatives in this thread:
https://stackoverflow.com/questions/3163479/what-is-a-good-alternative-to-svg-in-ie7
来源:https://stackoverflow.com/questions/6931089/google-charts-in-ie7