Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Same legend color for mutiple unique entry

  1. if you see below attached plot, s_ce0,s_dpu1,s_ce1 has same bar color i.e. blue and s_ce1 and s_ce0 has same color for scatter line i.e. orange

couldnt figure out why? can anybody help.

  1. how do i order my legned enteries, e.g. i want s_dpu0 and s_dpu1 at bottom of stack bar?

1 Like

Here are some legend item ordering options:

See https://github.com/plotly/plotly.js/issues/1701

@etienne for 1st problem, are you suggesting to use custome color instead of keeping plotly to add unique color for each entry?

To be honest, I’m not really sure what you’re hoping for here. I listed a few possible way to customize the legend style, I doubt it will be sufficiently for your needs, but it should help.

I am hoping to get more colors in legends, after bit digging in google and main src code found out plotly use d3.scale.category10 that means after 10 entries color will repeat, see below for easiest example.

https://stackoverflow.com/questions/40673490/how-to-get-plotly-js-default-colors-list/44727682#44727682

i am hoping to increase this color scale to category20 http://bl.ocks.org/aaizemberg/78bd3dade9593896a59d

1 Like