Skip to content

fix(axe-os): stop the chart stacking a fill per series - #1979

Open
SurefireStudios wants to merge 2 commits into
bitaxeorg:masterfrom
SurefireStudios:fix/chart-stacked-fills
Open

SurefireStudios wants to merge 2 commits into
bitaxeorg:masterfrom
SurefireStudios:fix/chart-stacked-fills

Conversation

@SurefireStudios

@SurefireStudios SurefireStudios commented Sep 16, 2026

Copy link
Copy Markdown

Split out of #1977 at @0xf0xx0's request — no colour-meaning changes here, just the chart.

Stacked fills

createChartDatasets passes the same fill flag to every series in a group:

return labels.filter(...).map((labelKey, index) => {
  ...
  return { type: 'line', label, data: ..., fill, backgroundColor, borderColor, ... };
});

backgroundColor is color-mix(in srgb, ${borderColor}, transparent 81%) — 19% opacity. With four supported sensors in a group that is four washes drawn on top of each other, and the stacked alpha makes the y1 area read as a solid block rather than a chart. Boards with fewer sensors show it less, which is probably why it survived.

Only the leading series in a group is filled now. One line:

const filled = fill && index === 0;

Second axis colour

Separately, the y2 group was built with textColorSecondary as its base and 'black' as its mix colour:

...this.createChartDatasets('chartY2Unit', textColorSecondary, 'black', false, 'y2')

On the dark theme that mixes each trailing series toward the background, so the further down the group a sensor sits the closer it gets to invisible. Adds --chart-axis2-color, mixes toward --color-text-main instead, and points the y2 tick colour at the same variable so the axis matches the series it scales.

If you would rather take only the fill fix and leave the axis colour alone, say so and I will drop the second half — they are independent.

Verified

npm run build in main/http_server/axe-os completes clean on Node 24 / Angular 19.

Before / after

Before After
Chart before Chart after

Those show the axis change: the right-hand scale and the ASIC Temp legend swatch go from the same grey as the gridlines to the group's own colour.

They do not show the fill change, and I would rather say so than imply otherwise — the shots are rendered against the fixture in home.component.spec.ts with the API stubbed, and I could not get the stub to feed the three rolling averages data that diverges from the raw figure, so only one series is drawn in both. On a device the four differ and the stacking is what you see.

--chart-axis2-color falls back to --color-text-secondary when unset, so a theme that does not define it renders exactly as today.

createChartDatasets passes the same `fill` flag to every series in a group,
so a group with four supported sensors drew four translucent washes on top
of one another. The stacked alpha made the y1 area read as a solid block
rather than a chart. Only the leading series in a group is filled now.

The second axis also took textColorSecondary for its series and 'black' as
its mix colour, so on the dark theme the trailing series were mixed toward
the background and became hard to separate. Adds --chart-axis2-color and
mixes toward the main text colour instead, with the axis ticks matching the
series they scale.
Copilot AI lite review requested due to automatic review settings September 16, 2026 16:37

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@0xf0xx0

0xf0xx0 commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

nack in current form, it should pick one of the active datapoints to fill instead of just the furst

Per review: picking index 0 meant that hiding that series from the legend
left the group with no fill at all, rather than moving the fill to a series
still on screen.

The fill target is now the first entry whose `hidden` is false. The legend
toggles `hidden` in place without rebuilding the datasets, so refreshChartFill
re-picks the target on toggle and calls ci.update() to repaint.

Colour assignment still keys off the original index, so a series keeps its
colour regardless of what is hidden.
@SurefireStudios

Copy link
Copy Markdown
Author

Good catch. With index === 0 the fill disappeared entirely when that series was hidden, instead of moving to one still on screen. Both default groups happen to lead with a visible series (hashrate, asicTemp), so it only bit once you toggled the leading one off from the legend.

Now picks the first entry with hidden === false. The legend handler mutates hidden in place without rebuilding the datasets, so refreshChartFill() re-picks the target on toggle and calls ci.update() to repaint; borderColor still keys off the original index, so a series keeps its colour whatever is hidden. Checked the selection across all-visible, first-hidden, first-two-hidden, all-hidden, single-series and the unfilled y2 axis — never more than one fill, none when everything is hidden. npm run build clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot/automated prs opened by agents

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants