Skip to content

Dates for X Axis #196

Answered by mhkeller
attilabuturla asked this question in Q&A
May 8, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

What values you use for your x and y axis are not a part of LayerCake and it has no opinions or restrictions. This is a more complex example but you can see that they axis is a date in the time of day plot example.

This isn't LayerCake specific but I can give you some general pointers about how best to work with dates.

You have a few options if you have dates for you axis. You may also want to look at some D3 charts that use dates and also look at d3-time-format.

  1. You can keep your dates as strings but use ISO-8061 YYYY-MM-DD format instead of what you have. Always include leading zeros in month and day values. This has the benefit that your strings will always sort in the correct order.
  2. P…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@attilabuturla
Comment options

@mhkeller
Comment options

@attilabuturla
Comment options

Answer selected by attilabuturla
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