3

我有一些使用 amCharts 绘制的数据。我获取所有数据,然后在用户生成图表时将其发布。函数加载图表(数据){

var chart = new AmCharts.AmSerialChart();
chart.dataProvider = data;
chart.categoryField = "age";
catAxis = chart.categoryAxis;
catAxis.gridCount = data.length;
chart.pathToImages = "../images/";
var graph = new AmCharts.AmGraph();
graph.balloonText = "[[category]]: [[value]]";
graph.valueField = "probability"
graph.type = "smoothedLine";
graph.numberFormatter = {precision:2, decimalSeparator:'.', thousandsSeparator:','};
graph.lineAlpha = 1;
chart.addGraph(graph);

无论如何要获取十进制数据并将其乘以 100 以获得使用 amCharts 的百分比,还是我必须更改发送到 amCharts 的数据以创建图表。

4

1 回答 1

2
graph.balloonText = "$[[category]]([[percents]]%)";
于 2014-01-21T07:59:29.953 回答