Amchart:仅显示特定系列的传说

时间:2019-07-30 09:36:31

标签: amcharts amcharts4

我有一个混合了柱形图和折线图的图形。我只想显示柱形图的图例。

我的完整代码在这里:https://codepen.io/European-DataLab/pen/wVJKrN?editors=0010

这是图例的代码:

// Legend settings
series.name = "Période référence";
series2.name = "Cotisation minimale";
chart.legend = new am4charts.Legend();
chart.legend.position = "top";
chart.legend.align = "center";

在我的示例中,显示了两行的图例。这是我的输出:enter image description here

但是,我希望得到以下输出: enter image description here

1 个答案:

答案 0 :(得分:1)

可能将hiddenInLegend属性设置为true

series.hiddenInLegend = true;

这应该按照下面的文档进行操作

https://www.amcharts.com/docs/v4/reference/series/#hiddenInLegend_property