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
Tag: d3.js
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 to parse new Date.now() object with D3.js to generate a linechart
I’m trying to make a linechart with D3 and React where the x axis is based on Date.now() object and all the ticks are a minute apart on a 10mn window. I can’t generate the line because I get “NaNNaNNaN” in my svg path; Can’t seem to figure out how to have ticks minutes apart on my x axis; Here’s
Change text color or display it on top of the path so the path won’t cover it
I am new to D3js and I have some sort of bug here. When the percentage of data is very low, the path will appear shorter too, logically. But that also “hides” my text which displays the data percentage. Is there any way possible to make my text white or at least make it appear on top of it’s path?
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
trying to create line down a graph in nivo at set time intervals
I’m using nivo charts to visualize some sick datasets. The example is like this, With the data simply like this, I want to really simply add in a at time 10, 14, 18 a line for when i exercise. Ideally, I’d like to be able to shade the area beneath that line for 4 hours afterwards, in a sort of
How Can I highlight the parents names and the connection lines when I hover on their child in family tree
I’m creating family tree using d3.js and i want to do 2 things how can i highlight the parents names and the connection lines when I hover on their child like this image when i hover on axelenter image description here how can i determine the last child in each branch so i can give it unique style or add
Is there an easy way to stop d3.csvParse when it hits a blank line?
I have CSV that has data 20ish rows of data I want, a few blank rows, and then some other stuff that other people are calculating off the data that they care about. Am using d3.csvParse and it picks up the extra lines. Is there any way to tell it to stop when it hits a blank row or can