FrancescoCastaldi commented on issue #45475:
URL: https://github.com/apache/superset/issues/45475#issuecomment-6524024356
### Architectural Proposal for Handling Out-of-Bounds Y-Axis Data Points
Regarding how out-of-bounds data points on a bounded Y-axis should be
represented:
When a Y-axis upper or lower bound is configured (`yAxisMax` or `yAxisMin`),
completely omitting points breaks time series continuity, while silently
clamping points to the boundary visually misleads users into thinking the value
equaled the limit.
A clean, production-grade approach consists of the following components:
1. **Preserve Raw Values in Series Data**:
Store the true value alongside the clipped coordinate in the series data
datum:
```typescript
{
value: [xVal, Math.min(yVal, yAxisMax)],
rawVal: yVal,
isClipped: yVal > yAxisMax || yVal < yAxisMin
}
```
2. **Visual Clamping Indicator on Points**:
For points where `isClipped === true`, customize the symbol:
- Use an upward triangle marker (`▲`) for points clipped at `yAxisMax`,
and a downward triangle marker (`▼`) for points clipped at `yAxisMin`.
- Optionally render the marker with a distinct border or dashed line
segment leading to it.
3. **Explicit Tooltip Notice**:
In the tooltip formatter, check if `datum.isClipped` is set:
```typescript
if (datum.isClipped) {
return `${seriesName}: ${formatNumber(datum.rawVal)} (truncated at axis
limit of ${formatNumber(yAxisMax)})`;
}
```
This gives users immediate clarity that the true metric was 33.2%, even
though the visual boundary capped the plot at 30.0%.
4. **Optional Canvas Badge**:
Display an info badge or banner on the chart header when one or more
series in the current view have clipped data points, alerting viewers that
values extend beyond visible axis bounds.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]