Skip to content
Advertisement

Tag: d3.js

D3 events in new versions

I have written the following snippet: I am aware that the d3.event has been removed in new releases, but reading through the documentation on how to handle the events in callbacks does not make me understand how to modify this… Can someone please explain this tiny bit to me and how to fix it to work, in a simple way

D3 mouse interactivity issues, circles not appearing at data points

I’m implementing some D3 code in class format so that I have a reusable chart. The errors are as follows: GetElementsByClassName returns an HTMLCollection of length 0, but elements to be selected are classed correctly. Circles appear at x0 and yMax, rather than at data positions (Issue is probably connected to the first). Text is not appended to circle and

How can I make rects from JSON?

I’m doing a project to learn d3 visualization and I’m stack recs aren’t appearing. Could you help me? I tried to put a simple array for data and it worked, I could only flip y, but with this JSON data. nothing works https://codepen.io/DeanWinchester88/pen/XWgjjeW Answer The issue is that XMLHttpRequest is asynchronous and you are defining the d3 logic outside of

Can’t append simple svg to body element

I know this is a super easy question. But I am apparently missing something super obvious. I just want to create an svg element with D3 and see it on my page. My index.htmllooks like this: Whereas my selections.js looks like this: The first console.log() is still visible in the console. But I cant see the svg. I know I

js d3 chart with timescale

I am a newbie coding js and d3, and I have the code below, I want to display the dates in array on the x axis instead of numbers. I tried many ways to display the dates; most of ways display the dates with no line and data with errors in the HTML console, that it could not read the

Advertisement