javascript - D3.js linear scale [0,1] with a specific number of string tick values [A,B,C,...] -
i using d3.js , display
a string scale specific number of ticks while maintaining linear range underneath it.e.g.
string scale [a,b,c,d,e,f,g,h,x] 9 components while maintaining linear range between [0,1]so if value
is 1 point should fall on "x" is 0.95 point should fall between "h" , "x" is 11.11 point should fall on "b"i'd this, of course of study doesn't work:
d3.svg.axis().scale(y).ticks(9).tickvalues([a,b,c,d,e,f,g,h,x]) or it's possible rewrite texts of ticks manually, unclean.
none of scales d3 provides back upwards you're looking for. either own scale implementation, or "hack" 1 of existing scales. sounds linear scale place start. wrap function take characters , replace labels on axis example.
javascript svg d3.js
No comments:
Post a Comment