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

111
Views
Datamap insert data array

I have a problem with inserting data via an array to populate the datamaps map.

My code is this, but it keeps giving me error, they don't like the for loop inside i.bubbles

(function($) {
"use strict"

var i = new Datamap( {
    scope: "world", 
    element: document.getElementById("world-map"), 
    responsive: !0, 
    geographyConfig: {
        popupOnHover: !1, 
        highlightOnHover: !1, 
        borderColor: "transparent", 
        borderWidth: 1, 
        highlightBorderWidth: 3, 
        highlightFillColor: "rgba(0,123,255,0.5)", 
        highlightBorderColor: "transparent", 
        borderWidth: 1
    }, 
    bubblesConfig: {
        popupTemplate: function (e, i) {
            return '<div class="datamap-sales-hover-tooltip">' + i.country + '<span class="ml-2"></span>' + i.sold + "</div>"
        }, 
        borderWidth: 0, 
        highlightBorderWidth: 3, 
        highlightFillColor: "rgba(0,123,255,0.5)", 
        highlightBorderColor: "transparent", 
        fillOpacity: .75
    }, 
    fills: {
        Visited: "#777", 
        neato: "#777", 
        white: "#777", 
        defaultFill: "#EBEFF2"
    }
});

i.bubbles([
    for(x=0; x<(length.array); x++){

        {
            centered: "DEU", fillKey: "white", radius: 5, sold: "75-sdjfbvksfnd", country: "German"
        },

    },
]),
window.addEventListener("resize", function (e) {
    i.resize()
});

})(jQuery);
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!