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

157
Views
simple barchart and axis are side by side. SVG graph

I have a stacked bar chart in the below codepen https://codepen.io/a166617/pen/qBXvzQd

As you can see the codepen, it doesn't show graph on x-axis and y-axis line. barchart slides away to the right. Can someone please let me know how to put barchart on the x-axis and y-axis of graph?

<g class="grid x-grid" id="xGrid">
  <line x1="90" x2="90" y1="5" y2="371"></line>
</g>
<g class="grid y-grid" id="yGrid">
  <line x1="90" x2="705" y1="370" y2="370"></line>
</g>

The code to achieve the line for the x-axis and y-axis is as follows. But somehow the graph does not show up on the line axis. Can someone please guide me where I am going wrong?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The way I would solve this is by using css positioning. I've added some additional code on your codepen. It's viable if your graph has static values. Check it out here. I've added this custom class on the div that contains the bars and title.

.mGraph > svg {
  position: relative;
  left: -40rem;
  top: -.65rem;
}

.mGraph > div {
  position: relative;
  left: -40rem;
  top: -.65rem;
}

.mGraph > text {
  position: relative;
  left: -50rem;
}
about 4 years ago · Juan Pablo Isaza Report
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!