Skip to content

Tighten glucose chart vertical padding (especially the bottom) - #72

Open
Sjoerd-Bo3 wants to merge 3 commits into
Build-Experimentfrom
feat/chart-padding-tighter
Open

Tighten glucose chart vertical padding (especially the bottom)#72
Sjoerd-Bo3 wants to merge 3 commits into
Build-Experimentfrom
feat/chart-padding-tighter

Conversation

@Sjoerd-Bo3

Copy link
Copy Markdown
Owner

Summary

The main glucose plot left a heavy empty band beneath the data — most noticeable when glucose runs well above the low threshold (the gap you marked in the screenshots). Two coupled sources:

  1. The y-domain padded symmetrically ±25 mg/dL.
  2. minYAxisValue = min(minOverall, lowGlucose - 20) — the floor was pulled 20 mg/dL below the low line, and then the −25 padding stacked on top.

Changes

  • MainChartView.paddedGlucoseYDomain: asymmetric padding — top 15 / bottom 8 mg/dL instead of 25/25. Bottom stays above 0 because FPU dots pin to minYAxisValue and need a little room.
  • ChartAxisSetup: low-threshold floor margin 20 → 10 mg/dL — still keeps the low/target rule marks off the plot edge, without the large empty band below.

Net effect: the plot floor sits much closer to the data / low line, and there's a bit less headroom up top too.

Verification

  • Compiles via CI. This is a layout-only change — please eyeball it on-device: the low threshold line should still be clearly inside the plot (not on the edge), FPU dots not clipped, and the bottom gap noticeably smaller. The numbers (15 / 8 / 10) are easy to tune further — tell me tighter or looser.

🤖 Generated with Claude Code


Generated by Claude Code

claude added 3 commits July 28, 2026 07:35
The plot left a heavy empty band beneath the data, most visible when
glucose sits well above the low threshold:
- Asymmetric y-domain padding (top 15 / bottom 8 mg/dL) instead of a
  symmetric 25, so the floor sits closer to the data. Bottom stays > 0 for
  the FPU dots pinned to minYAxisValue.
- Reduce the low-threshold floor margin from 20 to 10 mg/dL — enough to keep
  the low/target rule marks off the plot edge without the big gap below.

Layout-only; verify on-device.
FPU dots pin to minYAxisValue, but this build doesn't use carbs/FPUs, so
the bottom no longer needs room for them. Drop bottom padding 8 -> 3 mg/dL;
the low-threshold floor margin (10) still keeps the low/target lines off the
plot edge.
…t-padding-tighter

# Conflicts:
#	.github/workflows/compile_check.yml
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