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

105
Views
D3.JS Multiple Marker or circle on world mao

I am just trying to use D3.js for a map and have a scenario where I want to create multiple marker in different color for same location. For an example location New York has 2 category item listed and I category marker in red and another one is in green. How to achieve that. No matter whatever I do it only rendering one circle.

svg.selectAll(".countries").data(countries).enter().append("path").attr("class", "countries").attr("d", path);
    svg.selectAll(".circles")
        .data(listMapData)
        .enter()
        .append("circle")
        .attr("class", "circles")
        .attr("r", function (d) {
            return 13;
        })
        .attr("cx", function (d) {
            let coords = projection([d.Coordinates.Longitude, d.Coordinates.Latitude]);
            return coords[0];
        })
        .attr("cy", function (d) {
            let coords = projection([d.Coordinates.Longitude, d.Coordinates.Latitude]);
            return coords[1];
        })
        .attr("fill", function (d, i) {
            debugger;
            if (d.Category.indexOf("Market Survey") >= 0) return "yellow";
            else if (d.Category.indexOf("Investigation") >= 0) return "red";
            else if (d.Category.indexOf("Lead") >= 0) return "green";
            else if (d.Category.indexOf("Raid") >= 0) return "#943126";
            else if (d.Category.indexOf("Custom Seizure") >= 0) return "#4633FF";
            else if (d.Category.indexOf("Online Investigation") >= 0) return "green";
            else return "#34495E";
        })
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!