Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9170055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:57:50+00:00 2026-06-17T15:57:50+00:00

I am using the GeoChart from Google (https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart). I am trying to change some

  • 0

I am using the GeoChart from Google (https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart). I am trying to change some of the elements by using D3. I used their code as seen below:

google.load('visualization', '1', {'packages': ['geochart']});
//google.setOnLoadCallback(drawMarkersMap);

function drawMarkersMap() {
    var data = google.visualization.arrayToDataTable([
        ['Country', 'Popularity'],
        ['Germany', 200],
        ['United States', 300],
        ['Brazil', 400],
        ['Canada', 500],
        ['France', 600],
        ['RU', 700]
    ]);

    var options = {
        displayMode: 'markers'
    };

    var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));
    chart.draw(data, options);

    window.setTimeout(function() {        
        var svg1 = d3.select("svg").selectAll("rect")
            .filter(":nth-child(2)")
            .remove();
        console.log(svg1);
    }, 2000);

};

I am calling drawMarkersMap() from a different function and the timeout selects ONLY the rects of the svg. I then proceed selecting only the third rect which I want removed. The console log gives me this: [Array[0]], which is the selected rect as it should.
However nothing happens. I can remove all rect if I use: var svg1 = d3.select(“svg”).selectAll(“rect”).remove() but not the specific one.
Am I doing something wrong or Google GeoChart is not allowing this type of manipulation? Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:57:51+00:00Added an answer on June 17, 2026 at 3:57 pm

    According to the return value of selectAll() (that, as far as I understand from D3 documentation is an Array) the problem is that you use filter() to select the element you want to remove instead of navigating the array.

    Also, you may find useful this blog article that explain how to use selectAll() and other D3 features to use the element selected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Google Charts GeoChart: https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart Is it possible to zoom in closer than just
I'm using Google's GeoChart to display some activity data I've gathered from an outside
I'm trying to plot some cities on Google's Geochart. This function works perfectly fine
I'm using GeoChart from the Google Visualisation API to create a dynamic map containing
I'm trying to generate a GeoChart using a set of data retrieved from mysql
I'm trying plot markers in a specific city using google Geochart when the region
I am using google geochart to put markers on a map. I want to
I'm using Google's GeoChart API to generate a map of the US. I want
I'm using the Google Visualization Geochart API to create a map of a country's
Using rubular.com as a guide, I am trying to get this expression to work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.