How to redirect to a different URL when the user clicks on a bar
Problem:
How do I redirect to a different URL when the user clicks on a bar?
Solution:
You will need to make use of ZingChart's node_click event that dispatches when the user clicks a node. Use the method window.open(url, target)
to open a new window (it depends on the browser or the user's settings whether the URL is opened in a new window or tab). For more information about window.open()
, read the documentation at w3schools. Please note: Randomly opening a new window (or tab) isn't allowed in most browsers, because it is then treated as an "unwanted popup". Please use this demo for reference