Forum Discussion
Data Colours in Power BI
- 4 years ago
Hi Ashley
It is recommended to use JSON files to set colors in batches, and preset as many color categories in JSON file as possible to cover the categories in your data,
Introduction to report theme JSON files
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi! How did you get it to repeat your colors? I'm trying to customize my JSON theme, but I'm not sure how to get it to rotate through a set number of colors. I'd rather not manually define 300 colors.
Hi, just as I mentioned above I had to repeat my colour set multiple times in my JSON theme. the example looks like this:
"dataColors":["#FFFFFF","#00E0D1","#FF6C0E","#BFD0D8","#7C8DA0","#A0BAD0","#F5A800","#FFFFFF","#00E0D1","#FF6C0E","#BFD0D8","#7C8DA0","#A0BAD0","#F5A800","#FFFFFF","#00E0D1","#FF6C0E","#BFD0D8","#7C8DA0","#A0BAD0","#F5A800","#FFFFFF","#00E0D1","#FF6C0E","#BFD0D8","#7C8DA0","#A0BAD0","#F5A800","#FFFFFF","#00E0D1","#FF6C0E","#BFD0D8"]}
So as you can see, I defined my initial 7 colours and then just copy paste a bunch of times. That's the only way I could force it to iterate through the same colours. I'm no expert though so there may be some more suitable solutions haha.
- hoyt221 year agoHelper I
Thank you! I was hoping there was code to force the iteration, but I can't find anything like that. Copy and paste it is!