title: d3.js - Time scale with ticks in milliseconds
body: <p>I need to plot a line graph where x-axis will have ticks representing time with milliseconds detail.</p>
  
  <p>For x-scale, I am using <code>d3.time.scale()</code></p>
  
  <pre><code>var xScale = d3.time.scale()
      .range([0, width])
  </code></pre>
  
  <p>x-axis looks like:</p>
  
  <pre><code>var xAxis = d3.svg.axis()
      .scale(xScale)   
      //.ticks(d3.time.second, 1)
      .orient("bottom")        
      .tickFormat(d3.time.format("%H:%M %L"));
  </code></pre>
  
  <p>But values/ticks on x-axis are not generating as expected.</p>
  
  <p><img src="https://i.stack.imgur.com/4d9gq.png" alt="x-axis with time scale"></p>
  
  <p>data for x-axis are date objects and they hold following values(sample data)</p>
  
  <pre><code>13:25:6 794 (%H:%M%S %L)
  13:25:6 898 
  13:25:6 994 
  13:25:7 95 
  13:25:7 194 
  13:25:7 295 
  13:25:7 395 
  13:25:7 495 
  13:25:7 595 
  13:25:7 710 
  13:25:7 795 
  13:25:7 895
  13:25:7 995 
  13:25:8 95 
  13:25:8 195 
  13:25:8 294
  13:25:8 395 
  13:25:8 495
  13:25:8 594
  13:25:8 795 
  </code></pre>
  
  <p>However if I take linear scale <code>d3.scale.linear()</code>
  Ticks generated follow a expected series.</p>
  
  <p><img src="https://i.stack.imgur.com/obgGE.png" alt="x-axis with linear scale"></p>
  
  <p>whats the correct way of using <code>time scale</code> with data having millisecond details.</p>
  
  <p><strong><em>How can I have tick intervals in seconds:milliseconds?</em></strong></p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Also, how can I have ticks every few milliseconds say every 500 ms?</p>
  
  <p>there is an API <code>d3.time.second</code> but nothing like <code>d3.time.millisecond</code>. How can I add one?</p>
  
  <p><a href="http://jsfiddle.net/SGyQN/" rel="nofollow noreferrer"><strong>Fiddle</strong> using time scale</a></p>