AMCHARTS xy 图表数据标签

AMCHARTS xy Chart Data-Labels

我正在使用 AMCHARTS 创建气泡图,并希望每个气泡都被标记,但这似乎有点麻烦!

标签的参考点在我身上丢失了(似乎是左上角?)而且我似乎无法让它移动到我想要的位置。

我的javascript如下,附上一丁点fiddle

var chart = AmCharts.makeChart("chartdiv", {
    "type": "xy",
    "theme": "light",
    "dataProvider": [{
        "y": 10,
        "x": 14,
        "value": 59
    }],
    "allLabels": [{
        "text": "Label",
        "bold": true,
        "y": 10,
        "x": 14
    }],
    "graphs": [{
        "balloonText": "x:<b>[[x]]</b> y:<b>[[y]]</b><br>value:<b>[[value]]</b>",
        "bullet": "circle",
        "bulletBorderAlpha": 0.2,
        "bulletAlpha": 0.8,
        "lineAlpha": 0,
        "fillAlphas": 0,
        "valueField": "value",
        "xField": "x",
        "yField": "y",
        "maxBulletSize": 100
    }],
    "marginLeft": 46,
    "marginBottom": 35
});

JSFiddle

您正在使用全局标签。我想你想给每个气泡贴上标签。 您必须在 "graphs" 段中执行此操作,如下所示:

"graphs": [{
    "labelText": "[[value]]",
    "labelPosition": "middle"
}],

查看文档 here

已重做JSFiddle