1

我正在尝试使用 amCharts 和 jquery 在 balloonText 中格式化标签 [[value]]。我需要显示不带小数和千位逗号分隔符的数字标签 [[value]],例如 64578 为 64,578。如何格式化气球文本?

谢谢!。

 // Creates graph and adds it to actual chart
var createGraph = function (title, valueField, color, unit) {
    try {
        var graph = new AmCharts.AmGraph();
        graph.title = title;
        graph.labelText = "[[value]]";
        graph.balloonText = title + " of [[value]] " + unit + " \nRepresents [[percents]]% of total [[category]]";
        graph.valueField = valueField;
        graph.type = "column";
        graph.lineAlpha = 1;
        graph.fillAlphas = 0.6;
        graph.lineColor = color;
        chart.addGraph(graph);
    } catch (err) { showModalMessage("Error in createGraph() method: " + err); }
}
4

1 回答 1

1

你应该设置 chart.numberFormatter = {precision:0, decimalSeparator:'.', crowdSeparator:','}

于 2013-07-23T13:12:58.787 回答