-4

I came across https://stackoverflow.com/a/22523287, which is just:

All the while I was doing .style("fill", "darkOrange")

Then I found out the correct answer is .style('fill', 'darkOrange')

D3 is a JS library, and in JS, the kind of quote you use doesn't make it past the interpreter's parser. How has this question ended up having so many upvotes, despite obviously doing nothing?

I'm not saying some action should be taken here, I am genuinely curious.

9
  • I’m inclined to believe there was a quirk at that time such that the answer was infact correct… but I don’t actually know for sure. Basing this off of trusting certain users who were involved with that answer. Have you considered leaving a comment mentioning one of the commenters, asking for more info?
    – Kevin B
    Commented Sep 23, 2023 at 14:14
  • 12
    Another possibility is with 67k views a fair chance people searched how to change the color, pasted in the last part and it worked. The OP might have had some other problem and convinced themselves it was the quotes.
    – PeterJ
    Commented Sep 23, 2023 at 14:17
  • 1
    The daily vote summary can be seen in the timeline, and looks like it's still upvoted until recently. Though looking at the title and the code in the question, the accepted answer adds new codes, whichever may be correct.
    – Andrew T.
    Commented Sep 23, 2023 at 14:51
  • @AndrewT. how do you reach the timeline through normal UI? Is there a button somewhere or do you just have to remember the link format? Commented Sep 23, 2023 at 14:59
  • 2
    @JanSchultke it's the clock icon below the voting arrows and saves icons
    – Andrew T.
    Commented Sep 23, 2023 at 15:06
  • 2
    The question doesn't contain either quote variant of .style("fill", "darkOrange"). How is an answer providing those a no-op answer? Commented Sep 23, 2023 at 15:07
  • 5
    How does that question lack debugging details?! Hey, meta effect people!
    – VLAZ
    Commented Sep 23, 2023 at 15:17
  • 11
    THIS IS NOT A DEBUGGING QUESTION!!! Please do not close as Needs debugging details.
    – Dharman Mod
    Commented Sep 23, 2023 at 15:32
  • Here's an example of a similar thing happening Receive JSON POST with PHP
    – Dharman Mod
    Commented Sep 26, 2023 at 15:49

1 Answer 1

13

The question asks "How to set text color for my d3 chart title?". The answer is:

.style('fill', 'darkOrange')

or

.style("fill", "darkOrange")

I don't know if the quotes make any difference. They probably don't. But that doesn't mean that the answer doesn't contain the solution.

6
  • My bad--I just read the answer & was so confused that I forgot the context. Thank you for the reminder.
    – flaviut
    Commented Sep 23, 2023 at 16:17
  • The answer really does make the Q&A sound like a debugging question, though. I realized my mistake after I cast the last close-vote, and fortunately some people had the sense to also re-open it. Maybe it can be re-worded? Commented Sep 25, 2023 at 13:23
  • @GeneralGrievance It doesn't sound like a debugging question to me at all. There is no error message or an attempt shown. The question literally asks "how" not "why". But if you want to make an edit to clarify it, feel free to do so.
    – Dharman Mod
    Commented Sep 25, 2023 at 13:27
  • The answer originally said "I was trying X, but Y is correct", which logically implies that X was an attempt that OP had made before asking, but withheld from that question. However, nobody can find any evidence that X wouldn't work, or indeed would be understood any differently from Y, from which we infer that OP's code had something else unknown and thus unreproducible going wrong. Of course, we can and apparently did simply ignore that and proceed as if it were a direct how-to question, and people have already found it useful as a how-to question. Commented Sep 26, 2023 at 4:35
  • But there are people around who seem to think that authorial intent is far too important to transform "silly me, I did X instead of Y" into "you can do X or Y" (and then into "you can do Y", because the X mention is entirely redundant). The original phrasing is essentially admitting to a typo; if an analogous question were asked fresh today, and someone wanted to keep it open with the reasoning described in this discussion, I can imagine tons of complaints. Commented Sep 26, 2023 at 4:36
  • @karl I would not allow it to be closed.
    – Dharman Mod
    Commented Sep 26, 2023 at 8:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .