Skip to content

Commit

Permalink
docs: Fix "Layered chart with Dual-Axis" (Method syntax)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dangotbanned committed Oct 27, 2024
1 parent f7dfcc3 commit 5647f81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/examples_methods_syntax/layered_chart_with_dual_axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 5647f81

Please sign in to comment.