It is different from referred issue. How to rest zoom in Ordinal Scale in D3js
Here is Zoom code
function zoomed() {
svg.select(".allStates").attr("transform", "translate(" + d3.event.translate[0]+",0)scale(" + d3.event.scale + ",1)");
svg.select(".x.axis").attr("transform", "translate(" + d3.event.translate[0]+","+(height)+")").call(xAxis.scale(x0.rangeRoundBands([0, width * d3.event.scale],.5 * d3.event.scale)));
svg.select(".y.axis").call(yAxis);
}
How do I reset the scale ?
Hi friends
i got one solution for rest
svg.select(".allStates").attr("transform", "translate(0,0)","scale","(0,0)");
svg.select(".x.axis").attr("transform", "translate(0,450)").call(xAxis.scale(x.rangeRoundBands([0, width],.1)));
svg.select(".y.axis").call(yAxis);
But after rest when i move on the pan the svg chart will be be in zoom state ...can you plese sugest on this
Thank you