如何为 amCharts 柱形图添加图例?

问题描述 投票:0回答:2

我想向柱形图添加图例,但它没有按预期工作。

我所做的只是添加

"legend" : {}

查看图表。除了作为我的项目中的技术要求之外,图例还允许我通过单击适当的标记来隐藏各个列。 有人可以帮忙吗?

JSFiddle:http://jsfiddle.net/nhpy49h8/1/

javascript amcharts
2个回答
0
投票
"legend":{
  "useGraphSettings": true}

欲了解更多选项,请访问 其自己的网站


0
投票
chart.legend = new am4charts.Legend();
chart.legend.position = 'bottom';
chart.legend.fontSize = 9;
chart.legend.dy = 14;
chart.legend.scrollable = true;
chart.legend.itemContainers.template.clickable = false;
chart.legend.itemContainers.template.focusable = false;
chart.legend.data = [
    {"name":'Asia',"fill":'red'},
  {"name":'North America',"fill":'blue'},
  {"name":'Africa',"fill":'green'}
];
© www.soinside.com 2019 - 2024. All rights reserved.