Skip to content

for NaN, y1 and y2 with sort is different from y #2172

Answered by Fil
aboveyunhai asked this question in Q&A
Discussion options

You must be logged in to vote

The difference is that if you specify y you get implicit stacking, and the invalid datum is stacked as a rectangle of height equal to 0. Whereas if you specify y2, there is no stacking, thus y2 is NaN and the invalid datum is discarded. The difference is visible if you set stroke: "red", inset: -1,.

(Note that it is not "minimum" nor "maximum": Plot and D3 put invalid values at the end when they sort. For instance if you say sort: { x: "-y2" } to sort by descending y2, the invalid datum will still be to the right.)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@aboveyunhai
Comment options

@Fil
Comment options

Answer selected by aboveyunhai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants