Skip to content

Auto: can it be made to make a timeseries bar chart? #1800

Closed
@tophtucker

Description

@tophtucker

Currently, you can only make a bar chart with a temporal/quantitative independent axis if the dependent axis has a reducer specified (implicitly or explicitly). But you cannot make a temporal/quantitative bar chart with a simple value as the dependent encoding.

  • Plot.auto(olympians, {x: "date_of_birth"}).plot() → implicit count reducer on y, hence temporal bar chart
  • Plot.auto(aapl, {x: "Date", y: "Volume", mark: "bar"}).plot() → surprising sparse matrix of cells

I know the bar-interval thing is a perennial headache lol, and others have raised it, but I’m feeling the pain right now and feeling motivated to come up with something!

E.g. for Plot.auto(aapl, {x: "Date", y: "Volume"}).plot(), we get a line, but it is inappropriate to interpolate values between successive days, so (hairline) bars would be better.

I may have made this worse in #1674, which changed it to choose cell over rect if there's no reducer, which might've been too aggressive and prevents us from taking advantage of the rect's implicit y1 = 0. (But I'm sleepy and not sure it ever would've worked; can check later.) (Nope, see below.)

Might be improved by #1790.

Example notebook:

image

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