mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-31 07:38:16 +00:00
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:
1 parent
9479e3b17c
commit
b5499d7157
1 file changed
+3
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user