Skip to content

Commit

Permalink
Simplify syntax (#2991)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelostblom authored Mar 28, 2023
1 parent 37e91ec commit cb5ab75
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions tests/examples_arguments_syntax/bar_chart_with_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,12 @@
import altair as alt
from vega_datasets import data

source = data.wheat()

bars = alt.Chart(source).mark_bar().encode(
x='wheat:Q',
y="year:O"
)
source = data.wheat()

text = bars.mark_text(
align='left',
baseline='middle',
dx=3 # Nudges text to right so it doesn't appear on top of the bar
).encode(
text='wheat:Q'
base = alt.Chart(source).encode(
x='wheat',
y="year:O",
text='wheat'
)

(bars + text).properties(height=900)
base.mark_bar() + base.mark_text(align='left', dx=2)

0 comments on commit cb5ab75

Please sign in to comment.