Skip to content

period positioning #4912

Closed
Closed
@nicolaskruchten

Description

@nicolaskruchten

This issue is intended to apply in principle to scatter (not scattergl), bar, funnel, waterfall, ohlc and candlestick traces, and only applies in the context of (x|y)axis.type=date.

We need to be able to position marks along date axes not at a particular instant in time, but at the start/midpoint/end of a well-defined period (see related #4911).

Proposed new trace-level attributes:

  • (x|y)period: Standard duration notation like ‘m’ or millis
  • (x|y)period0: A specific boundary point timestamp which is used to compute all boundaries. This will allow us to define e.g. "quarters that start on Feb 1" or "weeks that start on Wednesdays" etc
  • (x|y)periodalignment: start/middle/end

Proposed backwards-compatible changes to traces with width parameter:

  • Start accepting period lengths
  • Defaults to (x|y)period if orientation=(v|h)
  • If specified as a period, then the bar widths are variable and the gaps are computed as a percentage of the local bar width

Note: the hoverlabel here will need some thought.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions