javascript - D3.js: Exteding the y-axis without making any changes to the existing chart -
i learning d3.js , using code: http://bl.ocks.org/caged/6476579 changed data sets bit , occupy whole chart(the values quite closer , larger given example). want extend y axis(and reduce bar size).
things tried: in rect attr, changed attribute height
height/2
, changes height of rectangle size not values of y axis.
tried change range values of y axis [height,0]
[height/2, 0]
, still no luck.
how achieve this? also, using "s" tickformat(not percentages in example)
you need edit y.domain
fit data. so, edit line
y.domain([0, d3.max(data, function(d) { return d.frequency; })]);
for example, make chart axis go 0 100%:
y.domain([0, 1]); // 0% 100%
Comments
Post a Comment