Page 1 of 1

Altair Scrollable -Diagramm

Posted: 18 Mar 2025, 18:47
by Anonymous
Ich versuche, Daten für jeden Tag zu zeichnen. Abhängig von der Auswahl der Daten kann es einige Tage oder mehrere Monate dauern. In beiden Fällen möchte ich die gleiche Skala (1 bar pro Tag) < /p>
Ich kann die Daten pro Tag ohne Problem zeichnen. Das Diagramm ist auch scrollbar, aber wenn ich mehrere Monate ausgewählt habe, zeigt es immer noch 30 Tage. Wenn ich nach links /rechts scrolle, gibt es keine Daten.
Was fehlt mir? < /P>

Code: Select all

timeunit='date'
a = alt.Chart(data).mark_bar(opacity=0.6).encode(
x=alt.X('date(Gemeldet_Am):T',
timeUnit=timeunit,
axis=alt.Axis(title='Zeitfenster', grid=False)),
y=alt.Y('count(ABC):Q',
axis=alt.Axis(title='Number of calls',grid=True)),color='mean(Sentiment):Q',
tooltip=[alt.Tooltip('count(ABC):Q'),
alt.Tooltip('mean(Sentiment):Q',title='Sentiment')]).interactive()

b = alt.Chart(data).mark_line(color='orange', interpolate='monotone').encode(
x=alt.X('date(Gemeldet_Am):T',
timeUnit=timeunit),
y='mean(Sentiment):Q').interactive()