[pull] main from SigNoz:main - #931
Merged
Merged
Conversation
…Bar (#12632) #### Description - Charts take a `stack` prop (`none` | `normal` | `percent`) and hand it to their config, which derives the fill bands, and for `percent` the percentage y-axis and a 0–100 soft range. Callers stop computing bands or transforming data — V1/V2 bar panels, Meter Explorer and Billing each drop their `setBands` call and declare `stack` instead. - Stacking is no longer bar-specific, so TimeSeries stacks too. The upcoming area chart is built on TimeSeries and needs this. - `percent` rescales each x-slice to its column total. Mixed-sign columns divide by the signed total, so shares can fall outside 0–100 and still sum to it; a column summing to zero yields zero. The percent range is soft rather than hard so those out-of-band shares stay visible. - Tooltips now report the pre-stack value, identically in every mode. They used to recover it by subtracting the series below, which only works while stacking is cumulative — `percent` discards the column total, so the raw value cannot be derived from the plot's data at all. - `stack` lives on the two chart prop types rather than the shared config builder props, so the ~10 other consumers of that builder (histogram, alert previews, infra metrics, …) never expose an option they cannot honour. No spec or API change: both bar panels still read the existing `stackedBarChart` boolean and map it to `normal`/`none`. `percent` is reachable from the chart layer but nothing selects it yet — that arrives with the panel spec change. #### Additional Information - Behaviour outside dashboards should be unchanged, with one exception: Meter Explorer and the V1 bar panel previously passed `seriesCount + 1` when computing bands, emitting a trailing band pointing at a series that does not exist (Billing passed the correct count). Deriving bands centrally normalises all three. - Thresholds still draw under `percent`, but no longer widen the scale — they carry source-unit values, so one at 500ms would stretch a percentage axis to 0–500. - percent also swaps the unit to a percent formatter and sets *soft* 0–1 limits (they normalise to 0–1, we use 0–100). It applies those limits only when the user set none; we always apply them, because our soft limits come from `spec.axes` in the source unit and are meaningless once values are normalised. - Commits are split so each one builds and is reviewable on its own: the stacking algorithm, the config derivation, the tooltip change, then the chart/consumer migration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )