gpt4 book ai didi

internet-explorer - 谷歌可视化图表即字体系列不受尊重

转载 作者:行者123 更新时间:2023-12-04 07:48:59 25 4
gpt4 key购买 nike

如您所见,我尝试设置字体系列,并且我已经尝试过文档中提到的各种方式:http://code.google.com/apis/chart/interactive/docs/gallery/piechart.html

但是在ie7-8(vml版)中显示的字体不对。这可能是 vml 问题而不是 google 问题,但我没有想法。谢谢大家!

    // Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});

// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {

// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Vote');
data.addColumn('number', 'Votes');
data.addRows([
['BLAH', blah],
['AHH', ahh]
]);

// Set chart options
var options = {
is3D:false,
width:200,
height:200,
fontSize: '14px',
fontName: 'Arial',
colors: ['#bcbdc0', '#FFF'],
legend: 'none',
pieSliceText: 'label',
backgroundColor: '#f8f6e8' ,
pieSliceBorderColor: 'black',
pieSliceTextStyle: {
color: 'black', fontName: 'Arial', fontSize:'14'
}

};

// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart-div-'+id));
chart.draw(data, options);
}

最佳答案

尝试更改为:

fontName: '"Arial"'

即在单引号内加额外的双引号。这对我有用(但看起来仍然很难看,因为使用的字体是 Arial Bold,但所有元素的大小似乎都是使用标准 Arial 设置的,导致所有单词末尾缺少像素)

关于internet-explorer - 谷歌可视化图表即字体系列不受尊重,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9169084/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com