GitHub user gkneighb created a discussion: Conditional (threshold) formatting for the Time-series Bar chart
### Summary Extend Superset's existing **conditional formatting** to the ECharts **Time-series Bar** chart (`echarts_timeseries_bar`): let users color individual bars by threshold rules, the same way the **Table** chart already does. ### Motivation In migration/feedback sessions, threshold-driven bar coloring (e.g. "bars below target in red, at/above in green") is a recurring ask — it's a standard Tableau capability. Superset already ships this pattern: - **Table** chart: `ConditionalFormattingControl` (`conditional_formatting` control; `>`, `<`, `≥`, `≤`, between + color choices). - **Big Number**: conditional formatting on the value. The Time-series Bar chart — one of the most-used viz types in migrated dashboards — has no equivalent, so users fall back to manual workarounds or leave it in Tableau. ### Proposed scope (v1) - **One chart type:** `echarts_timeseries_bar` only. Line/area/scatter are out of scope for v1 (they're separate viz types with their own control panels, so this is a clean, isolated addition). - **Reuse the existing control** (`ConditionalFormattingControl` / `ConditionalFormattingConfig`) — same operators and color options. No new control type. ### Proposed behavior - The rule's **target** is a **metric** on the chart (the Table targets a *column*; a chart has none, so the target dropdown is fed the chart's metrics via `mapStateToProps`). This is the one adaptation of the shared control. - At render, each **data point** whose metric value satisfies a rule gets that rule's color via ECharts `itemStyle`; non-matching points keep the series color. - **Multiple rules:** last matching rule wins (matching Table semantics). ### Open questions for the community 1. **Metric-as-target** adaptation of `ConditionalFormattingControl` — any objection, or a preferred pattern already used elsewhere? 2. **Stacked bars:** should v1 support per-segment coloring, or explicitly scope stacked out (per-segment threshold coloring can be visually ambiguous on a stacked total)? 3. **Scope:** is bar-only the right v1, or would maintainers prefer this land across all Time-series series types (bar/line/area) at once? 4. **Sizing:** does this read as an incremental PR (extending an existing control to one chart type), or does anyone see it as SIP-warranting? Confirming before opening a PR. Happy to implement — opening this first to confirm direction and sizing. GitHub link: https://github.com/apache/superset/discussions/42574 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
