3 ms·
> Why are there only 3 points in each graph when there are five items in JSONdata? I can't figure it out. Well this was a sneaky bug: There's an extra space at
by pothibo 13y ago
> Why are there only 3 points in each graph when there are five items in JSONdata? I can't figure it out.
Well this was a sneaky bug: There's an extra space at the end of the date in JSONData's last 2 elements(in the example and in the real code). This is why the last two were generating garbage value.
Wordpress is a real pain to work with when using code and it seems I introduced a bug when copying code over. It's going to be fixed shortly. As for the </code></pre>. Typo, my bad.
Regarding the CSS, I believe all the graphs behave the same way. Could you verify? I also can be reached @pothibo on twitter for further discussion ;)
I really appreciate your feedback.
(Edit: Gave the reason why the graph was only representing 3 data point instead of 5)
- pessimizer 13y ago>Well this was a sneaky bug: There's an extra space at the end of the date in JSONData's last 2 elements(in the example and in the real code). This is why the last two were generating garbage value. Thanks for that - my d3 understanding is tenuous, and I thought that it might have been even worse than I thought:) >Regarding the CSS, I believe all the graphs behave the same way. Could you verify? Not actually the css, but circles.enter() .append("svg:circle") .attr("style", "cursor: pointer;") .on("click", function(d) {d3.select("#demoAddRandom .value").text("Date: " + d.created_at + " amount: " + d.amount) All the graphs do behave the same way, but that code isn't introduced in the examples until the first time you refactor refreshGraph. It's always there in the actual code of the graphs.
- pothibo 13y agoOh wow, that was never suppose to be a part of the code I was showing. My apologies. Wordpress is a real mess when dealing with code & text. Everything is part of the same big textarea and because there's no code highlighting, I have to read everything again and again and again. Should be fixed now. Thanks!
- pessimizer 13y agoI think that it's worth it to keep in the code examples - because it's simple code to understand, and if you omit it newbies will be wondering if it's something that d3 is doing automatically.