I'm trying to make a bar graph which has its X axis's type as time. I formatted it using 'utcyearmonth', but the X axis's label repeats values.
Any ideas on what I'm doing wrong?
The code I have written is:
serie_temporal = alt.Chart(base_filtrada).mark_bar(size=60).encode(
x=alt.X(
'utcyearmonth(Data):T',
axis=alt.Axis(format="%Y %B"),
scale = alt.Scale(nice={'interval': 'month', 'step': 1})
),
y='sum(Valor):Q',
color='Tipo de despesa'
).properties(
height=400
)
I already tried changing the axis type from time to nominal, ordinal and quantitative and removing the scale configuration.
Instead, use:
x = alt.X("date:O", timeUnit="yearmonth")