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
Add two layers of data to a single SVG in d3.js

In d3.js, I am trying to add circles from two different datasets (actually two transformations of the same dataset) to the same SVG. Only the first ones are rendered : the other ones are not added (even if I look through the "element" pane). What am I doing wrong ? Thanks for your help

            canevas2.selectAll('circle')
                .data(dataSet1)
                .enter()
                .append('circle')
                    .attr('cx',(d,i) => 100+ (window.innerWidth-250)/4 *i)
                    .attr('cy',200)
                    .attr('r',d => d[1])
                    .attr('opacity',0.8)        


            canevas2.selectAll('circle')
                    .data(dataSet2)
                    .enter()
                    .append('circle')
                        .attr('cx',(d,i) => 100+ (window.innerWidth-250)/4 *i)
                        .attr('cy',200)
                        .attr('r',d => d[1])
                        .attr('opacity',0.8)        
            })
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!