For a published JSfiddle, you can create a selection from all text , which are strings (these are y-axis ticks), and then use .on("click", function) to link each label. Here is a working example:
d3.selectAll("text") .filter(function(d){ return typeof(d) == "string"; }) .style("cursor", "pointer") .on("click", function(d){ document.location.href = "http://www.example.com/" + d; });
I forked your JSFiddle and found the whole example there: http://jsfiddle.net/mdml/Qm9U7/ .
A better solution would be to have an array of Y axis values ββand use them to filter the text elements in the document, instead of checking if each data element is a text string. However, the best way to do this depends on the rest of the code, so it may differ from application to application.
source share