All Questions
Tagged with altair interactive
19
questions
2
votes
1
answer
1k
views
Altair / Streamlit: Is there any way to retrieve the value from a selection?
I am creating a web app with charts. If one hovers (and clicks) on a chart, I want to display more information about that element below (i.e. outside of) that chart. Currently, I am using the ...
1
vote
0
answers
170
views
Interactive altair chart that can change between monthly and yearly aggregates
I have a time series dataset and I wanted to plot line charts that display monthly and yearly changes.Some code provided below as an example. But instead of making two static charts, I'd like to have ...
1
vote
1
answer
393
views
How to display only one series on Altair chart
For the interactive legend example, I was wondering if there is a way to display only one series and hide others on the chart after running the code. Then, when clicking on the legend, the chart can ...
2
votes
1
answer
1k
views
Apply filter transform to Altair plot while keeping all legend categories
I'm trying to make a stacked bar chart with an interactive legend. I want to be able to select multiple categories from the legend, which will filter the categories shown in the stacked bars.
This is ...
1
vote
1
answer
620
views
How to add text on interactive Scatter on Altair?
I try to adapt the Selection Detail Example from altair doc (https://altair-viz.github.io/gallery/select_detail.html#selection-detail-example).
I won't detailed my Dataframe structure which is ...
1
vote
1
answer
961
views
Interactively changing Altair mark text: possibility for background color?
As part of a larger composite figure I have a chart displaying an image, which is accompanied by a mark_text chart, which puts the title of the image on the side of it. It is interactive such that ...
0
votes
1
answer
571
views
with altair mark_image, is it possible to zoom image?
I would like to use altair to display an image and make it interactive for zooming and panning.
Here is an example that does not work:
import altair as alt
import pandas as pd
im='data:image/png;...
1
vote
1
answer
758
views
Altair scatter plot to bar chart single select row of data frame
A newbie question for Altair visualization lib in Python.
I have a pandas dataframe, all columns are numeric but one column is a string label (see below). I am trying to build interactive chart, ...
1
vote
1
answer
596
views
How to pass a formula as "x variable" in Altair chart?
I have a pandas DF with two quantitative variables A and B.
I would like to build a graph as described in the example gallery (https://altair-viz.github.io/gallery/selection_histogram.html#selection-...
0
votes
2
answers
647
views
Can we add an interactive legend to the interactive line chart in Altair?
Goals:
On mouseover in the line chart, increase the thickness of the line,
gray-out all other lines, and gray out all other items in the legend
as well. See interactive line chart.
On click in the ...
2
votes
1
answer
1k
views
Altair - Interactive Legend to only show selected elements
I've got the following code
brush = alt.selection_interval()
selection = alt.selection_multi(fields=['Sex'])
color = alt.condition(selection,
alt.Color('Sex:N', legend=None),
...
2
votes
1
answer
86
views
Agregate functions block plot interactivity in Altair
Consider the following code adapted from: Altair website
import altair as alt
import pandas as pd
source = pd.DataFrame({
'a': ['A', 'B', 'B', 'B', 'E', 'F', 'G', 'H', 'I'],
'b': [28, 55, 43, ...
3
votes
1
answer
813
views
Is it possible to create an Altair binding to a datalist element instead of select?
I am attempting to set up an interactive filter of gene expression on a time-series plot. The documented method for creating this kind of filter is with select_single bound to an input form. For ...
0
votes
0
answers
195
views
Using Altair for interactive plot
I am trying to make an interactive graph using Altair. However, when I build the function, there was no error message but there is nothing plot as well.
Below is my code:
date_range_slider = pn....
1
vote
1
answer
625
views
Altair interactive chart: Show all axis labels while transform_filter only takes part of the data
See example below. What I would like to happen is that the barchart (on right) always shows all xlabels (A to Z), regardless of whether they exist in the selection (in left chart). I find a lot of ...