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 9176913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:12:59+00:00 2026-06-17T17:12:59+00:00

Edit: This question can be simplified, and here it goes: I am adding tryign

  • 0

Edit: This question can be simplified, and here it goes:

I am adding tryign to add a “circle” to a SVG. Turns out, the added circle is added to the DOM, but not to the svg, and is also not fitted to the scale.

<svg width="400" height="400">
    <g class="x axis" transform="translate(0,200)" fill="none" stroke="black" stroke-width="1" font-size="10px">
    <g class="y axis" transform="translate(200,0)" fill="none" stroke="black" stroke-width="1" font-size="10px">
    <circle fill="#008000" r="10" cy="56" cx="56">
    <circle fill="#008000" r="10" cy="56" cx="128">
    <circle fill="#008000" r="10" cy="56" cx="164">
</svg>
<circle fill="#ffff00" r="10" cy="344" cx="340.4"></circle>

What I am trying to accomplish can be seen here: http://jsfiddle.net/eNe3U/13/

In jsfiddle it works! This is how I want it!

It starts with 3 green circles from a data array from index 0 to 2. Then it gets updated using another dataset, index 1 to 3. This is how the first circle is removed and the last one is added in D3(, right?)

  1. moving + changing to red

  2. adding a yellow circle

  3. removing the first (green) circle. Perfect!

Now, when I try to use this in my visual studio project, adding the yellow circle does not work. I’ve been stuck for quite a while, maybe I have overlooked something or not fully understood the ways of D3.

So, here is my code: http://pastecode.org/index.php/view/66925872

pretty much the same as in the fiddle, just separated in 2 functions. Where is the bug?

 circle.enter().append("circle") // .data(mydata2, function(d) { return d.i; })
      .transition().delay(1000).duration(500)
      .attr("cx", function (d) { return xScale(d.x); })
      .attr("cy", function (d) { return yScale(d.y); })
      .attr("r", 10).attr("fill", "yellow");
  • 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-17T17:13:01+00:00Added an answer on June 17, 2026 at 5:13 pm

    circle.enter()…. doesn’t circle point to the svg circle element? shouldn’t it be svg.enter().append(“circle”) so that you append the circle to the svg?

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

Sidebar

Related Questions

G'day, Edit: While this question covers a situation that can arise in programming a
I have a simplified test scenario useful for asking this question: A Product can
EDIT in accordance with @Will suggestions here is a simplified question... Is there a
edit This question is solved! Having something weird. I'm using html { font-size: 100%
Edit: this question is outdated. The jsonlite package flattens automatically. I am dealing with
Edit This question has gone through a few iterations by now, so feel free
EDIT: This question is a duplicate of What is the difference between managed and
EDIT: This question was initially too general, I think. So What I really need
EDIT: This question is about finding definitive reference to MySQL syntax on SELECT modifying
[EDIT] This question is how do I do atomic changes to entity beans with

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.