diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b9923ff..0544d49b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## [Unreleased] +### Fixed + +- Fixed bug where panel axes were unintentionally anchored to zero when using + `FACET ... SETTING free => 'x'/'y'` (#410). + ## 0.3.1 - 2026-04-30 ### Fixed diff --git a/src/writer/vegalite/encoding.rs b/src/writer/vegalite/encoding.rs index 04a29c52..89675113 100644 --- a/src/writer/vegalite/encoding.rs +++ b/src/writer/vegalite/encoding.rs @@ -924,11 +924,8 @@ fn build_column_encoding( // Position scales don't include zero by default — but only when we set // an explicit domain. With free facet scales (no domain), VL computes - // the domain from data values. Setting zero:false in that case can exclude - // 0 from the domain, breaking charts with pre-computed stacking (y2/theta2 - // starts at 0). Let VL's defaults handle it instead. - let is_free = is_position_free_for_aesthetic(aesthetic, ctx.free_scales); - if aesthetic_ctx.is_primary_internal(aesthetic) && !is_free { + // the domain from data values. + if aesthetic_ctx.is_primary_internal(aesthetic) { scale_obj.insert("zero".to_string(), json!(false)); }