Skip to content

Conversation

@TylonHH
Copy link
Owner

@TylonHH TylonHH commented Jan 2, 2026

Motivation

  • Place the chart scale toggle inline with the energy price label/range so the control is visually adjacent to the price summary.
  • Allow users to switch chart scaling between 0–max and min–max modes to avoid misleading visuals.
  • Apply sensible rounding steps for axis bounds so min/max are clean and predictable for price and CO₂.

Description

  • Move the chart scale toggle into the same line as the energy price label in SmartTariffBase.vue and keep it as a two-button btn-group.
  • Add scaleMode data and setScaleMode method in SmartTariffBase.vue, compute chartScaleLabel, chartScaleZeroLabel, chartScaleRangeLabel, and chartScaleStep, and pass :scale-mode and :scale-step to TariffChart.
  • In TariffChart.vue add scaleMode and scaleStep props, compute stepped min/range for range mode and 0-based bounds for zero mode, normalize and clamp bar heights in valueStyle, and add roundDown/roundUp helpers.
  • Add translation keys for the new toggle labels in i18n/en.json and i18n/de.json.

Testing

  • Started the dev server with npm run dev (served on port 7071) and it became ready, which succeeded.
  • Ran a Playwright script to load the page and capture a screenshot, producing artifacts/tariff-chart-toggle-inline.png, which completed successfully.
  • No unit or integration test suites were executed as part of this change.

Codex Task

@TylonHH TylonHH merged commit ae83a56 into master Jan 2, 2026
@TylonHH TylonHH deleted the codex/adjust-price-bar-range-to-min-max-ovawt3 branch January 2, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants