✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚾️ It's finally Baseball season! Root for the home team... & Register for our Sports Analytics Webinar!

Colo(u)r palette


I’m using line charts to make timelines to show upcoming renewals (the bit on the right is the legend, with the text removed):

I decided to add the whole subscription history, rather than just the current billing period. I wanted to add the subscription history in a light grey, so as not to detract from the main point of the chart (the coloured segments).

It seems that, if I specify the colour of one line, the default colour palette gets replaced with something much less appealing:

Why might this be? The only thing I have changed is adding the extra light grey lines as additional traces. I don’t think it’s because I have more colours than the default palette, because that normally just cycles back through the palette.

I would far rather have the default colours, because the other charts in the app use them—and because they are just nicer colours! If there isn’t an easy way to get this back, does anyone have the hex codes for the colour palette, so I can just store them in an array?



PS it gets stranger: if I make the (more important) coloured traces overlap the grey traces, the colour scheme changes yet again!

Here’s what I see if I create the grey traces before the coloured traces (the grey traces run underneath the coloured ones):

Here’s what I see if I create the coloured traces before the grey traces (the grey traces do not run underneath the coloured ones—they simply end at the point the coloured ones begin):

Weird, eh? Is this expected behaviour?


Does anyone have any ideas? This is stopping me from deploying the tool I have built, because it looks really budget and I can’t understand why!