score:0

Accepted answer

you should be able to access the scale through xaxis.scale(). you should run this code after the graph has been drawn to make sure that the scale is set up properly.

score:0

to add some context to the solution by lars:

my xaxis is setup like:

chart.xaxis
  .tickvalues([
    date.parse('08/24/14'),
    date.parse('08/30/14'),
    // parsed dates..
  ])
  .tickformat(function(d) {
    return d3.time.format('%x')(new date(d))
  });

then, after the chart has been rendered (in the callback), i can then get the x position for a certain date value by doing:

chart.xscale()(chart.x()({ x: date.parse('11/01/14') }))

hope this helps someone. cheers.


Related Query

More Query from same tag