You can use the ternary operator to determine which image to add next to the stripes:
svg.selectAll(".images") .data(data) .enter() .append("svg:image") .attr("x", function(d) {return x(d.value) + 4; } ) .attr("y", function(d) { return y(d.sentiment) + 10; }) .attr("width", 42) .attr("height", 42) .attr("xlink:href", function(d){ return d.value < 20 ? "http://www.clipartbest.com/cliparts/Rid/8EG/Rid8EGpi9.png" : "http://www.clipartkid.com/images/15/cartoons-cartoon-logos-cartoon-logo-design-gHlQ6b-clipart.jpg" });
So, if d.value less than 20 (true), it adds the first link, otherwise (false) adds the second link.
Here is your updated script: https://jsfiddle.net/c3k8c3a4/
EDIT To display images next to ticks rather than bars, change the x and y tags, respectively. This is the fiddle: https://jsfiddle.net/6uasj8hz/
source share