gpt4 book ai didi

javascript - 全尺寸 AmCharts

转载 作者:行者123 更新时间:2023-11-28 00:22:54 27 4
gpt4 key购买 nike

我的网站使用 AmCharts,我想将其设为全尺寸。例如,我有以下代码:

<style>
#chartdiv {
width : 50%;
height : 500px;
float : left;
}
</style>
<script>
var chart = AmCharts.makeChart( "chartdiv", {
"type": "pie",
"theme": "light",
"autoMargins": false,
"marginTop": 2,
"marginBottom": 2,
"marginLeft": 2,
"marginRight": 2,
"fontSize": 14,
"dataProvider": [
{
"type": "Open Issues",
"number": op
},
{
"type": "Closed Issues",
"number": cl
},
{
"type": "Deferred Issues",
"number": df
},
{
"type": "Vendor Issues",
"number": ve
},
{
"type": "FAQ Issues",
"number": fq
}
],
"valueField": "number",
"titleField": "type",
"export": {
"enabled": true,
"libs": {
"path": "http://www.amcharts.com/lib/3/plugins/export/libs/"
}
}
} );
</script>
<div id="chartdiv"></div>

我想让图表完全展开。那可能吗?我引用了他们的网站帮助。它说使用边距为0并将自动边距设置为false,我已经尝试过但不起作用。

最佳答案

试试这个

 width : 100%;
height : 100%;

确保图表 div 上方没有任何父 div。

关于javascript - 全尺寸 AmCharts,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29814549/

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