Dashboard Records & Sessions chart has no legend, so its two series can only be told apart by colour
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- accessibility, frontend
Research direction
Start in apps/web/src/routes/_app/dashboard.tsx around lines 430–523 and review the existing Legend usage in components/LineGraph/LineGraph.tsx. Add translated names and a legend for the records and sessions areas, then run the dashboard unit test and the dashboard browser test named in the issue. Done when both series have translated legend labels and can be identified without hovering.
Written by the indexing model from the issue text.
Description
The dashboard's "Records & Sessions Trend" chart plots two series, a blue area for records and a green area for sessions, with no legend. The only way to tell which line is which is to hover a point and read the tooltip. Colour alone carries the distinction, which fails WCAG 1.4.1 (Use of Color): a colour-blind user, a user on a touch screen without hover, or anyone reading a screenshot or printout cannot tell the records line from the sessions line. The subject graph's LineGraph (components/LineGraph/LineGraph.tsx:123) already renders a recharts <Legend />; the dashboard does not import one.
Where
apps/web/src/routes/_app/dashboard.tsx:430-523. The chart has two Areas and no Legend:
<AreaChart data={combinedTrendsData} margin={{ bottom: 0, left: 0, right: 30, top: 10 }}>
...
<Area dataKey="records" stroke={chartColors.records.stroke} ... />
<Area dataKey="sessions" stroke={chartColors.sessions.stroke} ... />
</AreaChart>
The import at dashboard.tsx:10 (Area, AreaChart, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis) has no Legend, and the Areas have no name, so even a default legend would read "records" and "sessions" untranslated.
Reproduce
- Sign in as an admin on an instance with records and sessions (e.g. the demo data) and open the Dashboard.
- Look at "Records & Sessions Trend" without hovering.
Actual: two overlapping coloured areas with nothing saying which is records and which is sessions.
Expected: a legend reading "Records" and "Sessions" in the interface language, ideally also differentiated by more than colour (for example a dashed stroke on one series).
Tests
apps/web/src/routes/_app/__tests__/dashboard.test.tsx:it('should label both trend series in a legend, so records and sessions can be told apart without hovering'). The file already mocksrechartsto expose the props the page passes, so assert that aLegendis rendered and that eachAreareceives a translatedname.testing/src/specs/dashboard.spec.ts: assert the trend chart (dashboard-chart-records-sessions) contains the "Records" and "Sessions" legend labels.
Suggested fix
Give each Area a translated name (t({ en: 'Records', ... }), t({ en: 'Sessions', ... })), add <Legend /> to the AreaChart, and set strokeDasharray on one series.
- Dominant language
- TypeScript
- Stars
- 119
- Forks
- 19
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 56
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DouglasNeuroInformatics/OpenDataCapture
-
Area: Playground Bug Difficulty: Low Good First Issue Priority: Low
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
DouglasNeuroInformatics/OpenDataCapture#1805 ·
Maintainers usually reply within 1 day
-
Area: Instruments Bug Difficulty: Low Priority: Low
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
DouglasNeuroInformatics/OpenDataCapture#1801 ·
Maintainers usually reply within 1 day
-
Area: Instruments Bug Difficulty: Low Good First Issue Priority: Low
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
DouglasNeuroInformatics/OpenDataCapture#1800 ·
Maintainers usually reply within 1 day
-
Area: Instruments Bug Difficulty: Low Good First Issue Priority: Low
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
DouglasNeuroInformatics/OpenDataCapture#1799 ·
Maintainers usually reply within 1 day
-
Area: Instruments Bug Difficulty: Low Performance Priority: Medium
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
DouglasNeuroInformatics/OpenDataCapture#1795 ·
Maintainers usually reply within 1 day
All issues in DouglasNeuroInformatics/OpenDataCapture
Similar issues
-
Tenant
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
MTES-MCT/Dossier-Facile-Frontend#2061 ·
Maintainers usually reply within 1 day
-
area:frontend
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
interledger/publisher-tools#905 ·
Maintainers usually reply within 1 day
-
Add: Cbeebies PL SDOpenapproved check:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
iptv-org/iptv#54525 · 1 comment ·
Maintainers usually reply within 1 day
-
DB-plane provider_chat_options.* is accepted by config set but never merged into the loaded configPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:web
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
praetorianer777/GoTome#178 ·
Maintainers usually reply within 1 day