unbridled-41 opened a new issue, #4569:
URL: https://github.com/apache/rocketmq-dashboard/issues/4569
## Problem
The Metrics Explorer chart assigns colors to polylines with two different
slot formulas: a series that mixes scalar and native-histogram samples is split
into two lines using slots `index*2` and `index*2+1`, while a pure series uses
slot `index`. Both are modulo the 6-entry palette, and nothing de-duplicates
the assigned colors — so a **mixed series followed by any further series**
deterministically collides:
- series[0] mixed → scalar slot 0, histogram slot 1
- series[1] pure → slot **1** — identical to series[0]'s histogram line
The same collision repeats for every odd offset (`series[i]` mixed-scalar at
slot `2i` vs `series[2i]` pure, etc.). Two different polylines in one chart
then render with the same stroke color, and their legend swatches are
indistinguishable, which defeats the purpose of the mixed-series split
introduced by #4358.
## Evidence
- `web/src/components/MetricsExplorer.tsx:133-135` @ master `d50ffecc`:
```ts
color: SERIES_COLORS[(isMixed ? index * 2 + kindIndex : index) %
SERIES_COLORS.length],
```
- Regression (added in the linked PR): series[0] with both a scalar value
and a native histogram + series[1] scalar-only → 3 polylines drawn but only 2
distinct `stroke` values (`#52c41a` appears twice).
## Expected behavior
All polylines in a chart keep distinct palette colors whenever possible;
legend swatches stay matchable to their line.
## Related work
- #4358 (merged): introduced the scalar/histogram split with the slot
arithmetic that collides.
## PR
Fix incoming.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]