Skip to main content

All Questions

Tagged with
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 ...
V W's user avatar
  • 31
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 ...
shimiao's user avatar
  • 101
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 ...
shimiao's user avatar
  • 101
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 ...
Vermillion's user avatar
  • 1,288
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 ...
Bebio's user avatar
  • 409
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 ...
roble's user avatar
  • 304
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;...
roble's user avatar
  • 304
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, ...
alan turing's user avatar
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-...
Bebio's user avatar
  • 409
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 ...
blehman's user avatar
  • 1,950
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), ...
sahmed's user avatar
  • 69
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, ...
Alina V's user avatar
  • 119
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 ...
A Richter's user avatar
  • 128
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....
Sasiwut Chaiyadecha's user avatar
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 ...
Niels Hameleers's user avatar

15 30 50 per page