0

我正在使用javascript Amchart。我需要将 balloonText 设置为

  if value is "1" means "1 point" as balloonText , 
  if more than one means(Ex:5), "5 points " as balloonText . 

谁能帮我实现这个?

4

1 回答 1

2

您可以通过在数据数组中定义一个变量来在悬停气球中分配用户定义的文本,如下所示。

var d = {
    date: new Date(year_s,mon_s,date_s,hr_s,min_s,sec_s),
    customBullet: "round",
    balloonTextField: value+" points"
};

然后您必须将新创建的变量分配到如下图所示。

graph.balloonText = "[[balloonTextField]]";
chart.addGraph(graph);
于 2013-02-27T16:31:04.680 回答