【问题标题】:Increase Size of Pie Chart in Amcharts在 Amcharts 中增加饼图的大小
【发布时间】:2015-03-16 07:29:40
【问题描述】:

我目前正在使用 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

但是还是不行。

【问题讨论】:

    标签: javascript amcharts


    【解决方案1】:
    AmCharts.makeChart("chartdiv",
      {
        "type": "pie",
        "radius": 100,
        "fontSize": 14
      }
    );
    

    设置“半径”...

    【讨论】:

    • 其实radius是增加圈子大小的正确方法,因为innerRadius是增加或减少圈子内的空空间的正确方法。我不知道你为什么被否决。
    【解决方案2】:

    我忘了添加这个:

    "autoMargins": false,
    

    它成功了!

    【讨论】:

    • 正确答案是加"radius": 100,
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-29
    • 1970-01-01
    • 2019-08-05
    相关资源
    最近更新 更多