0

I want to add a click event when I click some link in Amchart Navigation Bar, my code:

chart.navigationBar = new am4charts.NavigationBar();
chart.navigationBar.events.on('hit', (ev) => {
    console.log(ev);
});

I just don't know how to get the link text I clicked. Say, I have navigation "Home > Help > Question", if I click "Home", how can I get the text "Home" from the click event, so I can do corresponding operation?

Ying
  • 11
  • 2

1 Answers1

0

This will give you text of clicked link

chart.navigationBar.events.on("hit", ev => {
   console.log(ev.target.activeLink.currentText);
},this);
www.amitpatil.me
  • 3,001
  • 5
  • 43
  • 61