Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-line time axis for ordinal time scales #1789

Closed
mbostock opened this issue Aug 4, 2023 · 0 comments · Fixed by #1790
Closed

Multi-line time axis for ordinal time scales #1789

mbostock opened this issue Aug 4, 2023 · 0 comments · Fixed by #1790
Labels
enhancement New feature or request

Comments

@mbostock
Copy link
Member

mbostock commented Aug 4, 2023

If the interval option is used in conjunction with an ordinal scale, we should be able to use the nice multi-line time axis to choose appropriate ticks and tick format automatically. For example, I should be able to drop the ticks and tickFormat option here and get the same result:

image

Plot.barY(
  aapl,
  Plot.groupX(
    { y: "median", title: "min" },
    { title: "Date", x: "Date", y: "Close" }
  )
).plot({
  x: {
    interval: "month",
    tickFormat: "%Y",
    ticks: d3.utcYears(...d3.extent(aapl, (d) => d.Date))
  }
})

Related #932.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant