You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Automatically or Manually Scale Y-Axis in Line Chart #1619
It's very difficult to see the trends of each line the graph above. There's a total of 6 lines that could differ in the pennies range, but that's not easily distinguishable from above.
If there was a way to set the min value on the Y-Axis to something closer to the minimum value of all points on the graph and set the max value of the Y-Axis to something close to the max value of all points on the graph, then it would be easier to visualize fluctuations between lines. Doing this automatically would be great, but having a manual option to configure this would be just as valuable.
@claude add a new Display Setting for time series (line / bar) charts that sets the y-axis lower bound to the lower bound of the displayed data (the default should remain lower bound = 0).
Add fitYAxisToData setting to schemas (common-utils + external API)
Add "Fit Y-Axis to Data" checkbox to Display Settings drawer (line/bar only, default off)
Wire setting through EditTimeChartForm → DBTimeChart → MemoChart y-axis domain
Add unit tests for the new checkbox
Commit & push
Summary
I added a new "Fit Y-Axis to Data" display setting for time series (line / bar) charts. When enabled, the y-axis lower bound follows the minimum of the displayed data (with 10% padding) instead of being pinned at zero — making small fluctuations between many similar lines (like the pennies-range example in the issue) much easier to see. The default remains lower bound = 0, so existing charts are unaffected.
How it works
New checkbox in Display Settings → "Fit Y-Axis to Data", shown only for Line and Stacked Bar charts.
The setting is persisted on the chart config (fitYAxisToData) so it survives save/reload, and is exposed in the External API v2 line/bar schemas for parity.
The y-axis domain logic in MemoChart now lets the lower bound drop to the data minimum when the setting is on (it still respects series-selection zoom and keeps the upper bound auto-scaled).
Files changed
packages/common-utils/src/types.ts — added fitYAxisToData to SharedChartSettingsSchema
packages/api/src/utils/zod.ts — added fitYAxisToData to external line/bar chart schemas
packages/app/src/components/ChartDisplaySettingsDrawer.tsx — new checkbox + default
packages/app/src/components/DBEditTimeChartForm/EditTimeChartForm.tsx — watch/read/write the setting
packages/app/src/components/DBTimeChart.tsx — pass setting to the chart
packages/app/src/HDXMultiSeriesTimeChart.tsx — y-axis domain honors the setting
packages/app/src/components/__tests__/ChartDisplaySettingsDrawer.test.tsx — new tests
Note on validation:make ci-lint / make ci-unit could not be run in this sandboxed environment (the build/test commands were blocked by the approval gate). However, the pre-commit hook (lint-staged) ran and passed on the changed files, and these checks will run in CI on the PR. Please confirm the CI run is green before merging.
Activity
pulpdrew commentedon Jun 4, 2026
@claude add a new Display Setting for time series (line / bar) charts that sets the y-axis lower bound to the lower bound of the displayed data (the default should remain lower bound = 0).
github-actions commentedon Jun 4, 2026
Claude finished @pulpdrew's task in 5m 55s —— View job •
claude/issue-1619-20260604-1234• Create PR ➔Task: Add Y-Axis Lower Bound Display Setting ✅
fitYAxisToDatasetting to schemas (common-utils + external API)EditTimeChartForm→DBTimeChart→MemoCharty-axis domainSummary
I added a new "Fit Y-Axis to Data" display setting for time series (line / bar) charts. When enabled, the y-axis lower bound follows the minimum of the displayed data (with 10% padding) instead of being pinned at zero — making small fluctuations between many similar lines (like the pennies-range example in the issue) much easier to see. The default remains lower bound = 0, so existing charts are unaffected.
How it works
fitYAxisToData) so it survives save/reload, and is exposed in the External API v2 line/bar schemas for parity.MemoChartnow lets the lower bound drop to the data minimum when the setting is on (it still respects series-selection zoom and keeps the upper bound auto-scaled).Files changed
packages/common-utils/src/types.ts— addedfitYAxisToDatatoSharedChartSettingsSchemapackages/api/src/utils/zod.ts— addedfitYAxisToDatato external line/bar chart schemaspackages/app/src/components/ChartDisplaySettingsDrawer.tsx— new checkbox + defaultpackages/app/src/components/DBEditTimeChartForm/EditTimeChartForm.tsx— watch/read/write the settingpackages/app/src/components/DBTimeChart.tsx— pass setting to the chartpackages/app/src/HDXMultiSeriesTimeChart.tsx— y-axis domain honors the settingpackages/app/src/components/__tests__/ChartDisplaySettingsDrawer.test.tsx— new testsNote on validation:
make ci-lint/make ci-unitcould not be run in this sandboxed environment (the build/test commands were blocked by the approval gate). However, the pre-commit hook (lint-staged) ran and passed on the changed files, and these checks will run in CI on the PR. Please confirm the CI run is green before merging.· Branch:
claude/issue-1619-20260604-1234feat(charts): add 'Fit Y-Axis to Data' display setting for line charts (