Skip to content

Multi-line time axis for ordinal time scales #1789

Closed
@mbostock

Description

@mbostock

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions