Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

80
Views
D3 X-Axis Stretches While Zooming

The X-Axis Scale of my Bar Chart Stretches and Contracts when I zoom in and out. Also, the scale overflows out of the set clip-path (No such issues with the Bars). I've tried to get the X-Axis Scale to Re-Scale, but I was unable to do it. Also this is a Dynamic Bar Chart, where its updating at constant intervals, I've resolved many issues it had, I'm just left with this one. Can anyone help me with this?

My Code: https://plnkr.co/edit/qU5DfrAPnkFfB3sT?open=lib%2Fscript.js&preview

Zoom Function:

const zoom = d3.zoom()
zoom.scaleExtent([0.5, Infinity])
    .on("zoom", ({ transform }) => {

        const scaleFactor = transform.k;
        const xOffset = transform.x;
        
        zoomGroup.attr('transform', `translate(${xOffset} 0) scale(${scaleFactor} 1)`);
        xAxisGroup.attr('transform', `translate(${xOffset} 260) scale(${scaleFactor} 1)`);

   
    });
svg.call(zoom);
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!