Javascript 如何覆盖Google可视化的包含维度?
我正在尝试使用谷歌可视化来编程一个条形图 条形图是动态生成并更改多次的 Google Visualizations似乎很难检测到我通过jQuery动态附加的div元素的维度。因此,我想将条形图的尺寸硬编码到我输入Google Visualizations的选项中 我该怎么做 我尝试过这些选择Javascript 如何覆盖Google可视化的包含维度?,javascript,google-visualization,Javascript,Google Visualization,我正在尝试使用谷歌可视化来编程一个条形图 条形图是动态生成并更改多次的 Google Visualizations似乎很难检测到我通过jQuery动态附加的div元素的维度。因此,我想将条形图的尺寸硬编码到我输入Google Visualizations的选项中 我该怎么做 我尝试过这些选择 var options = { title: 'Comparing Kangeroos and Wallabies', vAxis: {title: 'Factors', titleTe
var options = {
title: 'Comparing Kangeroos and Wallabies',
vAxis: {title: 'Factors', titleTextStyle: {color: 'red'}},
legend: 'bottom',
chartArea.width: '400px',
fontName: 'Arial Narrow'
};
然而,Chrome Web Developer只是注意到“chartArea.width”中有一个意外的句点。示例显示:
title:"Yearly Coffee Consumption by Country",
width:600, height:400,
vAxis: {title: "Year"},
hAxis: {title: "Cups"}
因此,请尝试使用“宽度”而不是“chartArea.width”尝试
chartArea:{width:400}
,就像您给出的表格中的chartArea示例所示
编辑:更改为数字,因为它表示“简单数字是以像素为单位的值”