Skip to content

chart: Add chart.grid theme color for grid lines - #3236

Merged
madcodelife merged 1 commit into
mainfrom
chart-grid-color
Sep 25, 2026
Merged

madcodelife merged 1 commit into
mainfrom
chart-grid-color

Conversation

@madcodelife

@madcodelife madcodelife commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Description

Chart grid lines were painted in the theme's border color, the same as the axes, which reads too heavy behind the data. This adds a chart.grid theme color for grid lines only.

  • LineChart, AreaChart, BarChart, CandlestickChart and RadarChart grids now use chart_grid. Axes and pie leader lines stay on border, reference lines stay on muted_foreground, so the axis now reads one step above the grid.
  • The default theme sets chart.grid to neutral-200/60 (light) and neutral-800/60 (dark).
  • A theme that leaves chart.grid unset falls back to border at 60% opacity, so third-party themes get the lighter grid too. It is translucent rather than blended with background, so it sits right on cards and other surfaces.
  • .theme-schema.json, the Theme story color list and the Chart docs (en / zh-CN) include the new key.

Public API

gpui-component

  • ThemeColor::chart_grid: Hsla — chart grid line color, read from chart.grid in the theme file.
  • Theme file key chart.grid — optional; falls back to border at 60% opacity.

How to Test

  1. cargo run -- chart and compare the grids in light and dark mode, including grid_columns and the radar chart.
  2. cargo test -p gpui-component --lib theme:: covers both an explicit chart.grid and the fallback.

Checklist

  • I have read the CONTRIBUTING document and followed the guidelines.
  • Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate.
  • Passed cargo run for story tests related to the changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@madcodelife
madcodelife merged commit a4dd3fd into main Sep 25, 2026
12 checks passed
@madcodelife
madcodelife deleted the chart-grid-color branch September 25, 2026 15:35
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