Repository navigation
Description
On a workspace where every issue was created in the same week, the "Scope and completed over time" card draws nothing. The card, the legend and the two date labels all render, and the plot area is empty. It reads as a chart that failed to load, and people report it as one.
It is not a loading failure. It is a one point series being asked to draw a line.
Why it happens
scopeSeries in packages/core/src/analytics/distribution.ts buckets issues by week between the first created_at and the last completion. A workspace whose history fits inside one week gets exactly one bucket, so series.length === 1.
That array reaches linePath in apps/web/src/features/charts/geometry.ts:
export function linePath(values: readonly number[], max: number): string {
if (values.length === 0) return '';
return values
.map((value, index) => {
const command = index === 0 ? 'M' : 'L';
return `${command}${chartX(index, values.length).toFixed(2)} ${chartY(value, max).toFixed(2)}`;
})
.join(' ');
}With one value the output is a single M160.00 6.00. A path that is only a move command has no length, so SVG paints nothing. areaPath then closes a zero width shape, which also paints nothing.
ScopeSection guards on series.length === 0 and shows a sensible empty state, so the zero case is handled. The one case falls straight through.
What to do
Draw something for a single point. The two reasonable options, in order of preference:
- Render a dot. When
values.length === 1, emit a small circle atchartX(0, 1)andchartY(value, max)instead of a path. This is honest: there is one observation and here is where it sits. - Emit a flat segment. Repeat the point so the path spans the width. Simpler, but it implies a trend across time that the data does not contain, so prefer the dot.
Whichever you pick, Histogram and BurndownChart in the same directory share this geometry and have the same hole. Check them and fix them in the same change.
Files
apps/web/src/features/charts/geometry.tsapps/web/src/features/charts/line-chart.tsxapps/web/src/features/charts/burndown-chart.tsxis inapps/web/src/features/analytics/apps/web/src/features/charts/histogram.tsx
Reproducing it
bun run db:seed loads a demo workspace whose issues span enough time to hide this. The quickest reproduction is a unit test:
expect(linePath([5], 10)).not.toBe('M160.00 6.00');Tests
A test in apps/web/tests/features/charts/geometry.test.ts covering zero, one and many points. There is currently no test file for geometry.ts, so this is also a small coverage win.
Read CONTRIBUTING.md first. bun run verify must be green, and there are no comments in code.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
Activity
imshashank commentedon Aug 15, 2026
Still a live bug, but the reproduction in the description no longer exists. Re-baselining rather than closing.
What changed. The planning cockpit in #309 replaced the analytics charts. The "Scope and completed over time" card came from
scope-section.tsx, which nothing imports any more, and its replacementapps/web/src/features/analytics/charts/line-plot.tsxrenders a<circle>per point alongside the path. A single-bucket series paints a dot there, which is option 1 from this issue.scopeSeriesindistribution.tsis also no longer on the shipping path.What is still broken.
linePathinapps/web/src/features/charts/geometry.tsis unchanged, andapps/web/src/features/charts/line-chart.tsxstill draws onlylinePathandareaPathwith no point markers. Verified on3ba32cb. So a one-point series still paints nothing, on two surfaces that still ship:apps/web/src/app/(app)/projects/[slug]/layout.tsx, the project overview chartapps/web/src/features/sprints/cycle-board.tsx, the sprint board chartA new project or a fresh sprint is exactly the case that produces one bucket, so this is now easier to hit than the original workspace-wide version, not harder.
Revised scope. Same fix, different files. Render a marker when
values.length === 1inline-chart.tsx, or handle it ingeometry.tsand let both callers benefit.histogram.tsxshares the geometry and should be checked in the same change.burndown-chart.tsxis no longer rendered, so it can be skipped or deleted.The suggested unit test still stands as written:
apps/web/tests/features/charts/geometry.test.tsstill does not exist, so the coverage win is still there. This is still a good first issue.ayam04 commentedon Aug 29, 2026
Taking this one. Going with option 1 from the issue: emit a small circle for a single-point series (honest rendering, no implied trend). Will check Histogram and Burndown consumers of linePath/areaPath per the note.
fix(charts): render a dot for single-point series instead of an empty…