From 5647f81c246d9184fd674cd3ab7e97879b6bf832 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Sun, 27 Oct 2024 12:52:03 +0000 Subject: [PATCH] docs: Fix "Layered chart with Dual-Axis" (Method syntax) Discovered while writing tests for #3659. The attribute syntax version is what is displayed, but the method syntax one was not equivalent. Results in no `titleColor` being applied and is silently ignored during validation. https://altair-viz.github.io/gallery/layered_chart_with_dual_axis.html --- tests/examples_methods_syntax/layered_chart_with_dual_axis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/examples_methods_syntax/layered_chart_with_dual_axis.py b/tests/examples_methods_syntax/layered_chart_with_dual_axis.py index 6f6cd86d6..3947380a2 100644 --- a/tests/examples_methods_syntax/layered_chart_with_dual_axis.py +++ b/tests/examples_methods_syntax/layered_chart_with_dual_axis.py @@ -15,12 +15,12 @@ ) area = base.mark_area(opacity=0.3, color='#57A44C').encode( - alt.Y('average(temp_max)').title('Avg. Temperature (°C)', titleColor='#57A44C'), + alt.Y('average(temp_max)').axis(title='Avg. Temperature (°C)', titleColor='#57A44C'), alt.Y2('average(temp_min)') ) line = base.mark_line(stroke='#5276A7', interpolate='monotone').encode( - alt.Y('average(precipitation)').title('Precipitation (inches)', titleColor='#5276A7') + alt.Y('average(precipitation)').axis(title='Precipitation (inches)', titleColor='#5276A7') ) alt.layer(area, line).resolve_scale(