plotly / plotly/plotly.R

Hoverlabels in stacked area charts with ggplotly not working properly

Open
#2,225 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

Hello there!

When creating a stacked area chart with ggplot in R and using ggplotly to create a plotly version of it, there occurs a rather grave error: in the hoverlabel only the frist value for each trace is shown. Say, I have years on the x axis, then for all years 2019 will be displayed, even though the value belongs to 2023.

My minimum code sample is here: https://plotly.com/ggplot2/filled-area-plots/

The official tutorials samples show the same behaviour on my Linux machine, all packages up to date.

Would really enjoy it if that were to be fixed!

Best regards!
Alex

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 with the minimum example linked in the issue, https://plotly.com/ggplot2/filled-area-plots/, and reproduce the stacked area chart on the current packages. Trace how ggplotly constructs hover labels for the stacked traces; done means each year displays the value belonging to that year rather than the first year in the trace.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
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.