From e443388d91f3e9c1aabbaa960767a59c918dc76d Mon Sep 17 00:00:00 2001 From: mattijn Date: Fri, 13 Oct 2023 09:39:49 +0200 Subject: [PATCH] use datum as baseline remove calculate transform --- .../bar_chart_with_highlighted_segment.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/examples_arguments_syntax/bar_chart_with_highlighted_segment.py b/tests/examples_arguments_syntax/bar_chart_with_highlighted_segment.py index fb073edae..0322e0ce8 100644 --- a/tests/examples_arguments_syntax/bar_chart_with_highlighted_segment.py +++ b/tests/examples_arguments_syntax/bar_chart_with_highlighted_segment.py @@ -20,19 +20,19 @@ highlight = alt.Chart(source).mark_bar(color="#5BA3CF").encode( x='year:O', - y='baseline:Q', - y2='wheat:Q' + y='wheat:Q', + y2=alt.datum(20) ).transform_filter( alt.datum.wheat > 20 -).transform_calculate("baseline", "20") +) highlight2 = alt.Chart(source).mark_bar(color="#2978B8").encode( x='year:O', - y='baseline:Q', - y2='wheat:Q' + y='wheat:Q', + y2=alt.datum(60) ).transform_filter( alt.datum.wheat > 60 -).transform_calculate("baseline", "60") +) rule = alt.Chart(threshold).mark_rule().encode( y=alt.Y("threshold_value")