Open thoechsmann opened 6 years ago
Hi! You can manually set colors for charts on the "Colors" settings tab:
Yes, I know. And we do that. But we have LOTS of charts with the same labels and we have to set the color for all of them in every single query and even in every single visualisation.
A nice solution would be a list of name-color pairs in the global settings. (maybe even allow wildcards) A label will use the first color where the name matches.
I would love to find some solution that doesn't require creating configuration for colors, as this introduces its own challenges. If anyone got ideas, don't be shy 🤓
Maybe we could have an "autocolor" mode that is enabled with a single boolean setting, that would automatically populate the color values in a predictable way, e.g. alternating complementary colors that vary by a few grades of R, G or B per iteration? Maybe start at a not-quite-white and end at a not-quite-black?
@jezdez how is it different than today's auto color picker?
Oh right, I missed the important part 😬: "..automatically populate the color values in a predictable way based on the label".
just brainstorming here
could be a column_name: color
mapping on the dashboard level that is applied to every widget on the dashboard when you access it. If you use the "Colors" settings tab from the query visualization, it should take priority.
I did not stopped to see how the code is nowadays, but ideally I imagine the settings being like:
"redash global settings" > "dashboard settings" > "query settings" > "query visualization settings"
Maybe 'autocolor' will take series name such as 'male' or 'female', and takes md5hash of it, then take lowest byte of the hash to calculate red, second to lowest for blue, etc. Calculation could be bit-AND, or mod 256 or whatever. This should always assign a fixed color to any series by default.
@deecay and in case of collision, it will pick the next available color?
@arikfr no I was thinking of one way only. Md5 or other hasing function might give us just enogh randomness.
@arikfr @deecay d3
has ordinal color scales intended exactly for this usage pattern (and no md5
needed)
If I'm not mistaken, d3 scales function will return the same color for the same input value, but only for the current invocation /instance. But you might get different color between page refreshes.
I might be wrong, so worth checking.
On Mon, Jun 24, 2019, 19:12 Levko Kravets notifications@github.com wrote:
@arikfr https://github.com/arikfr @deecay https://github.com/deecay d3 has ordinal color scales https://d3-wiki.readthedocs.io/zh_CN/master/Ordinal-Scales/ intended exactly for this usage pattern (and no md5 needed)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/getredash/redash/issues/2873?email_source=notifications&email_token=AAAROLATRPR7VI4HCFPJ3BDP4DXALA5CNFSM4FXZKTFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYNN5ZI#issuecomment-505077477, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAROLAIJLUUVWATQNZMZEDP4DXALANCNFSM4FXZKTFA .
We have lots of graphs where we have the same groups. We always have to assign colors manually so the same label gets the same color.
For example we have many plots grouped by the platform like Android, iOS, Facebook. It would be great if we could maybe globally assign default colors to a label name.