plotly / plotly.js

Open-source JavaScript charting library behind Plotly and Dash
https://plotly.com/javascript/
MIT License
17.08k stars 1.87k forks source link

Box trace with `boxpoints="all"` and `line_width=0` doesn't render marker in legend #7159

Open jnumainville opened 1 month ago

jnumainville commented 1 month ago

When the width of a box trace is set to 0 and boxpoints is set to "all", it seems that the legend still attempts to render the box in the legend, which will never appear because the width is 0. It seems that in this case the marker should appear in the legend instead, as is already the case when the line alpha is 0.

I'd be happy to work on this as well.

import plotly.express as px

df = px.data.tips()

fig = px.strip(df, x="total_bill", y="day", color="time")
new_fig = fig.update_traces(line={"color": None, "width": 0})
new_fig.show()

image