增加Amcharts中饼图的大小

时间:2015-03-16 07:29:40

标签: javascript amcharts

我目前正在使用amchart版本3来生成饼图。它在中心显示饼图,尺寸非常小。我怎样才能增加它的大小?

这是我的代码:

AmCharts.makeChart("chartdiv",
        {
        "type": "pie",
        "pathToImages": "classes/amcharts/images/",
        "balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
        "titleField": "type",
        "valueField": "number",
        "fontSize": 14,
        "marginLeft": 10,
        "marginRight": 10,
        "marginBottom": 10,
        "marginTop": 10,
        "theme": "light",
        "allLabels": [],
        "balloon": {},
        "titles": [
        {
            "text": "Issue Statistics",
            "size": 18
        }
        ],
        "dataProvider": [
        {
        "type": "Open",
        "number": op
        },
        {
        "type": "Closed",
        "number": cl
        },
        {
        "type": "Deferred",
        "number": df
        },
        {
        "type": "Vendor",
        "number": ve
        },
        {
        "type": "FAQ",
        "number": fq
        },
    ]
    }
);

我尝试使用marginbottom和其他边距属性,如下所述:

http://docs.amcharts.com/3/javascriptcharts/AmPieChart

但它仍然没有用。

2 个答案:

答案 0 :(得分:4)

AmCharts.makeChart("chartdiv",
  {
    "type": "pie",
    "radius": 100,
    "fontSize": 14
  }
);

设置“半径”......

答案 1 :(得分:0)

我忘了补充一下:

"autoMargins": false,

它有效!