I have created the d3 time axis,
//minDate and maxDates are javascript date object.
var timeScale =d3.scaleTime().domain([minDate,maxDate]).range(
[0, width]);
var timeAxis = d3.axisBottom(timeScale);
And i have added the zoom interaction to this axis
//gX is group div that has timeAxis.
gX.call(d3.zoom(timeScale).scaleExtent([0,4]).on("zoom",function(d){
//Do something.
}))
but initially i want to set the zoom level of the axis in day level,default it is showing in hour level,So finally what i am curious is,
From what i understand it's the times factor of the zoom. 4 would be mean: magnified 4 times.
I know this is 4 years old post. Back then were there no documentation? This seems to explain pretty thoroughly.
[k0, k1] where k0 is the minimum allowed scale factor and k1 is the maximum allowed scale factor, and returns this zoom behavior. If extent is not specified, returns the current scale extent, which defaults to [0, ∞]. The scale extent restricts zooming in and out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With