Skip to content

A Table chart is as tall as its rows, and a bar chart grows with its bars - #507

Open
namedgraph wants to merge 2 commits into
developfrom
fix/chart-canvas-height
Open

namedgraph wants to merge 2 commits into
developfrom
fix/chart-canvas-height

Conversation

@namedgraph

Copy link
Copy Markdown
Member

The bug

Every chart was drawn 400px tall, twice over: .chart-canvas { height: 400px } in ldh.css, and height = 400 passed by ldh:RenderChart to ac:draw-chart for every chart type, Table included.

  • A Table of a few rows has them stretched to fill 400px; a long one is cut off.
  • A horizontal bar chart draws its categories down the side; once they no longer fit in 400px, Google Charts skips every other label (a bar chart of 25 items names 13 of them).

The fix

  • ldh:RenderChart (client/block/chart.xsl) passes no height for ac:Table, max(400, 120 + 30 × rows) for ac:BarChart, and 400 for the other charts as before.
  • .chart-canvas holds 400px as a min-height while it loads instead of a fixed height, so the drawing sets the height; a canvas holding a Google table has no minimum, as the empty state already had none.

Tests

New specs/document/blocks/chart/size.spec.mjs (owner), each test seeding its own document:

  • a Table of three rows has no stretched row and a canvas shorter than 400px;
  • a bar chart of the 25 fixture items labels every bar.

Not run locally: the dev stack's preflight fails before any spec (it publishes the fixture package registry to packages.localhost:4443, which only tests/http/config/dataspaces.trig declares). Left to CI.

🤖 Generated with Claude Code

namedgraph and others added 2 commits October 29, 2026 18:00
…bars

Every chart was drawn 400px tall: by .chart-canvas in ldh.css and again
by the height ldh:RenderChart handed ac:draw-chart, whatever the chart
type. A Table of three rows stretched them to fill 400px and cut a long
one off. A bar chart draws its categories down the side, and once they
no longer fit Google Charts skips every other label.

ldh:RenderChart passes no height for a Table, and for a bar chart
max(400, 120 + 30 per row); the other charts keep 400. The canvas holds
400px as a min-height while it loads instead of a fixed height, so the
drawing sets it, and a canvas holding a table has none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant