0

我有以下实现。有多个对象(数据和图例)被推入要绘制的图表中。想象一下,很少有对象的图例信息是相同的,当我运行代码时,图表上会显示多个相同的图例信息。

我该如何处理这些重复的图例信息?

for (i = 0; i < dataSeriesBit.length; i++) {
    for (j = 0; j < self.colorMap.length; j++) {
        var d = dataSeries[i].data.filter(function (x) { return x.color == self.colorMap[j] });
          an.push({ data: d, name:"Size:"+d[0].n.toString()});
          }
}
chart.options.series = an;
4

1 回答 1

1

每个系列都有一个 visibleInLegend 属性,您可以将其设置为 true 或 false。您还可以隐藏特定系列的工具提示:

series: [{
    name: "FieldName",
    visibleInLegend: false,
    tooltip: {
       visible: false
    }
}]

例子

于 2015-05-21T02:02:01.270 回答