Skip to content

feat: add data labels, metric component, and gauge breakpoint labels#23

Merged
nicomiguelino merged 2 commits into
developmentfrom
feature/chart-labels-and-metric-support
Jun 26, 2026
Merged

feat: add data labels, metric component, and gauge breakpoint labels#23
nicomiguelino merged 2 commits into
developmentfrom
feature/chart-labels-and-metric-support

Conversation

@nicomiguelino

Copy link
Copy Markdown
Contributor

Summary

  • Add inline value labels on bar, pie, donut, and line charts via chartjs-plugin-datalabels
  • Add Metric component type support with container-relative responsive font sizing
  • Add breakpoint value labels drawn directly on gauge arc segments
  • Add gauge component to screenshot test fixture

- Add chartjs-plugin-datalabels for inline value labels on bar, pie, donut, and line charts
- Add metric component type support with responsive container-relative font sizing
- Add gauge breakpoint labels drawn on arc segments via canvas
- Disable datalabels plugin on gauge chart to prevent ghost labels
- Add gauge component to screenshot test fixture
@nicomiguelino nicomiguelino self-assigned this Jun 26, 2026
@nicomiguelino nicomiguelino marked this pull request as ready for review June 26, 2026 15:31
@nicomiguelino nicomiguelino requested a review from Copilot June 26, 2026 15:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds richer dashboard visualizations by introducing inline chart value labels, a new Metric component renderer with responsive typography, and gauge breakpoint labels rendered directly onto the gauge.

Changes:

  • Register chartjs-plugin-datalabels and configure per-chart-type inline value labels for bar/line/pie/doughnut charts.
  • Add Metric component rendering (visualizationType === 'metric') and corresponding CSS for container-relative font sizing.
  • Enhance gauge rendering by drawing breakpoint labels on arc segments and updating the screenshot fixture to include a gauge component.

Reviewed changes

Copilot reviewed 6 out of 22 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/render/index.ts Adds Metric rendering path and new renderMetric implementation.
src/render/gauge.ts Draws breakpoint labels on the gauge arc; updates needle rendering and disables datalabels for gauge.
src/render/chart.ts Registers ChartDataLabels plugin and adds datalabels/scales helper builders.
src/css/style.css Enables container queries on chart containers and styles the metric value display.
package.json Adds chartjs-plugin-datalabels dependency.
e2e/screenshots.spec.ts Extends screenshot fixture dashboard to include a gauge component and layout changes.
bun.lock Locks chartjs-plugin-datalabels dependency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/render/index.ts Outdated
Comment thread src/render/gauge.ts Outdated
Comment thread src/render/gauge.ts Outdated
Comment thread src/render/gauge.ts
Comment thread e2e/screenshots.spec.ts
- Simplify renderMetric to read directly from T!T factMap key
- Guard drawGaugeNeedle against NaN/Infinity pct values
- Guard drawGaugeBreakLabels against zero/negative range
- Add metric component to screenshot test fixture
@nicomiguelino nicomiguelino merged commit 1e90fc7 into development Jun 26, 2026
1 check passed
@nicomiguelino nicomiguelino deleted the feature/chart-labels-and-metric-support branch June 26, 2026 15:50
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.

2 participants