Skip to content

Multi-line date labels can collide with scale label #1859

Open
@tophtucker

Description

@tophtucker
Contributor

If the date axis is not named one of the special names we suppress, the axis label may collide with the tick labels. (I see why this happens and auto margins are very tricky but I wanted an issue to track this.)

untitled (65)

Plot.plot({
  marks: [
    Plot.rectY(pizza, Plot.binX({ y: "count" }, { x: "order_date", tip: true })),
    Plot.ruleY([0])
  ]
})

Activity

Fil

Fil commented on Sep 13, 2023

@Fil
Contributor

Wouldn't you want to leave the margin as is, and remove 2023?

tophtucker

tophtucker commented on Sep 13, 2023

@tophtucker
ContributorAuthor

In this specific case, I’d really probably just want to remove the label “order_date”. But I can imagine wanting a label on a date axis and wanting it to adjust automatically if it’s multi-line. Though I know it may not be easy to infer if it’s multi-line! So maybe this is more similar to #383.

added
bugSomething isn’t working
on Sep 26, 2023
added a commit that references this issue on Oct 3, 2023
17928d2
linked a pull request that will close this issue on Oct 3, 2023
added a commit that references this issue on Oct 12, 2023
e1dbe2c
added a commit that references this issue on Jul 29, 2024
64538a8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @Fil@tophtucker

      Issue actions

        Multi-line date labels can collide with scale label · Issue #1859 · observablehq/plot