plotly / plotly/plotly.py

Pie chart and hover_data: multiple values are all shown under same label

Open
#2,924 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

A simple recreation code

df_2007 = px.data.gapminder().query("year==2007")

fig = px.pie(df_2007, values="gdpPercap", names="lifeExp",
                 hover_name="country", hover_data=["continent", "pop"])

fig.show()

on hover it shows
continent = continent_name, pop_value
while pop as pop = %{customdata[1]}

image

I believe this is not the expected behavior and it should work with pie like it does with scatter. If there is an alternative way, please let me know.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Python reproduction with px.data.gapminder() and inspect the generated pie-chart hover output. Compare the hover_data labels and values with the expected separate continent and pop entries, then verify that the corrected behavior matches the existing scatter behavior described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.