Skip to content

Commit

Permalink
use datum as baseline remove calculate transform
Browse files Browse the repository at this point in the history
  • Loading branch information
mattijn committed Oct 13, 2023
1 parent 16e4fdd commit e443388
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit e443388

Please sign in to comment.