d3.js - d3 - dashed line from a datapoint to an axis (seen in dimplejs.org) -


i draw dashed line datapoints x/y axis (on mouseover). thus, value can read better on axis , looks awesome (seen in dimple).

i'm looking solution how can achieve or example.... grateful tip!!

enter image description here

update 1

it works , can draw lines. want draw more animated - possible svg:line?

var dpx = d3.select(this).attr('x'); var dpy = d3.select(this).attr('y');                  var myline = d3chart.append("svg:line")                     .attr("class", 'd3-dp-line')                     .attr("x1", dpx)                     .attr("y1", dpy)                     .attr("x2", 0)                     .attr("y2", dpy)                     .style("stroke-dasharray", ("3, 3"))                     .style("stroke-opacity", 0.9)                     .style("stroke", dpchannel.color); 

you can plot lines 2 points each:

  • the horizontal line have 1 point coordinates (0, circley) , (circlex, circley)
  • the vertical 1 have (circlex,0) , (circlex, circley).

where of course circlex , circley coordinates of circle in image


Comments

Popular posts from this blog

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

Python ctypes access violation with const pointer arguments -