RGraph is a JavaScript charts library based on
HTML5 SVG and canvas. RGraph is mature (over 16 years
old) and has a wealth of features making it an ideal
choice to use for showing charts on your website.
Get the latest version of RGraph (version 6.20, 1st December 2024) from
the download page. You can read the changelog here. There's also older versions available,
minified files and links to cdnjs.com hosted libraries.
// Add a mousemove listener that changes the mouse cursor to the hand
label.addEventListener('mousemove', function(e)
{
e.target.style.cursor = 'pointer';
}, false);
// Add a click listener that shows an alert
label.addEventListener('click', function(e)
{
alert('Text: '+ label.innerHTML);
}, false);
</script>
</body>
</html>
------8<------
There's a codepen here that demonstrates it (only the first label is clickable - but it's easy to change that to all of the labels):