I am currently working with d3.js and have to work with seconds and microseconds. For this I intend to use a axis that is formatted similar to this:
I tried using two x-axes but the problem is that I don't know how to make the µ-sec axis dependent on the sec axis in order to restart the µ-sec numeration from zero after a new sec tick.
Here's a example of a data entry:
{"id": 0, "start": 5667572130, "end": 5667581035, "taskName": "t"},
And heres how I initialize the two axes:
x = d3.scale.linear().domain( [ timeDomainStart, timeDomainEnd ] ).range( [ 0, width ] ).clamp( true );
x2 = d3.scale.linear().domain( [ timeDomainStart/1000000, (timeDomainEnd/1000000) ] ).range( [ 0, width ] ).clamp( true );
xAxis = d3.svg.axis().scale( x ).orient( "bottom" ).tickSize( 4 ).tickPadding( 4 ).ticks(5);
x2Axis = d3.svg.axis().scale( x2 ).orient( "bottom" ).tickSize( 8 ).tickPadding( 8 ).tickFormat( d3.format( "f" ) ).ticks(10);
Here's a jsfiddle, it is based one following gantt example https://dk8996.github.io/Gantt-Chart/