i. the first one is a line chart with two bar charts as traces
ii. the second one is a pie chart that changes everytime a user hover the data on the bars of the first chart
In my code of the callback I set that all of the possible pie charts will be the same size, the same color. the same everything. This is the code for the pie chart:
Hi, I would inspect with f12 developer tools to check for différences in actual representation between the two. This will give you a better understanding what’s wrong. You can even manually adjust to better catch what’s going on
Hi, well it’s hard to say really since it’s not an exact science. The idea is that you select (in F12 dev mode) an item in the layout of the page (like the graph / legend / … or whatever has the deviant behavior) and you see in real time what CSS attributes change when hovering over it. This way you can also compare with the working on. Sorry I can’t be more precise, but there are video’s online about chrome f12 dev tools and css troubleshooting. it’s a good skillset to have.
BTW most likely it’s because in the second graph the percentage is outside of the graph to the left and the legend might be calculated on the size of the actual pie, which looks smaller in the second picture, causing the legend to be on top of each other instead of side by side
I think problem comes from legend styling and I think you should try to add entrywidth in your legend = dict(orientation = 'h', xanchor = "center", x = 0.5, y= 0, font=dict(size=14)) (Plotly must be higher than version 5.11)