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

223
Views
D3 Styles Not Being Applied

I am trying to produce a bar chart using d3 but I cannot seem to properly apply the styling. I import the data using d3.dsv(...) and then call

.then(function (data) {
      d3.select("body").selectAll("div")
        .data(data)
        .enter()
        .append("div")
        .styles({
          'width': '5px',
          'background-color': 'teal',
          'margin-right': '2px'
        })
        .style("height", function (d) {
          return d.total_amount + "px"
        }); 

I can see that there is a new div being created for each element in data but none of the styling is being applied. I've looked through some of the other posts here but I still don't see what I'm doing wrong.

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!