javascript - maintain distance between axis ticks in d3 chart -
i trying draw chart using d3-js. want x axis values [0.25yrs; 0.50yrs; 1yr; 2yrs; 5 yrs; 10yrs; 15yrs; 20yrs; 30 yrs; 50 yrs]
. can done using d3's tickvalues()
& tickformat()
functions. need maintain distance between 0.25, 0.50 & 1 year ticks, because values belong these years & more distance between them reduce overlapping of drawn circles.
the tick position need :
you can see distance between .01 , .02 in above image. how can that?
you need implement custom scale maps input range non-uniform output range. can give scale axis , draw ticks accordingly.
you have @ scales d3 provides if close enough want (a log scale maybe?), if can't find have no choice implement own.
Comments
Post a Comment