Skip to content

2/5 Bar rendering — 8-block bars + y-axis labels #8

Description

@MohnDoe

Parent

#6 — BarChart — reusable vertical bar chart component

What to build

Render actual bars from BarItem[] data using 8-block unicode precision (▁▂▃▄▅▆▇█). Each bar occupies a column of computed width, with 1-space gap between bars. Bar height proportional to value / maxValue, mapped to 8 equal-sized buckets per text row. Any positive value gets at least .

Y-axis with auto-density (every 1st/2nd/3rd row based on height) and configurable yAxisSpacing override. Y-axis values formatted via formatValue callback (default: String(Math.round(v))). Range configurable via minValue/maxValue options (default: 0-based from data). Y-axis separator string configurable via yAxisSeparator (default: " │ ").

Acceptance criteria

  • Bars rendered at correct proportional heights using ▁▂▃▄▅▆▇█
  • Positive values always show at least ▁
  • Zero values show empty column
  • Y-axis auto-density adapts to chart height
  • yAxisSpacing overrides auto-density
  • yAxisSeparator overrides default
  • formatValue callback formats y-axis tick labels
  • minValue/maxValue clamp/expand the y-axis range

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    consideringProposal under consideration, not yet accepted

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions