Fix up merged PRs: waterfall axis scale uses the running totals

main's axis_scale now reads plotted_extent rather than value_range, which #537
taught about waterfalls; route waterfall charts to value_range there too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-14 13:41:50 -04:00
co-authored by Claude Opus 5.5
parent 9479e3b17c
commit b5499d7157
+3
View File
@@ -369,6 +369,9 @@ impl Chart {
/// stacked series as running sums from zero, 100 % series as 0–1. `(0, 0)` without finite
/// values; `None` when no series uses the axis.
fn plotted_extent(&self, secondary: bool) -> Option<(f64, f64)> {
if self.kind == ChartType::Waterfall {
return (!secondary).then(|| self.value_range());
}
let ser: Vec<&Series> = self.series.iter().filter(|s| self.on_secondary(s) == secondary).collect();
if ser.is_empty() {
return (!secondary && self.kind != ChartType::Combo).then_some((0.0, 0.0));