javascript - mouse over event line path d3 -


i created multi line graph d3.

i'm trying create handler each line (path) doesn't work.

here code creating path:

var line2 = d3.svg.line()             .x(function(d, i){return x(axvalues[i])})             .y(function(d, i){return y(ayvalues[i])});   p2 = svg.append("path")                 .datum(articledata)                 .transition()                 .delay(1100)                 .attr("id", "p"+i)                 .attr("class", "p"+i)                 .attr("d", line2(axvalues, ayvalues))                 .style("stroke", "brown")                 .style("stroke-width", 2)                 .style("fill", "none"); 

im trying this:

.on("mouseover", this.style("stroke-width", 5)); 

you can through css 'hover' event, instance p2 class applying can have css looks this.

p2:hover {  stroke-width: 5; } 

hovering on change stroke-width 5, , once hover event on element go original stroke-width


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -