Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello, I am new here, so I apologize if this isn;t in the right forum thread.
I am working on developing a corporate JSON theme. For the first level dataColors field at the top of the JSON file, I have put our 8 main branded colors:
"dataColors":[
"#77787B",
"#7B003F",
"#3D6DA8",
"#52B9E9",
"#FDBF63",
"#517891",
"#58595B",
"#D6A244",
However, when specifying for a visual like the line chart, I can pull the examples from Githubs like this: https://github.com/MattRudy/PowerBI-ThemeTemplates
Where I can see we can set a default color as defaultColor like such:
"dataPoint": [{
"defaultColor": { "solid": { "color": "#3D6DA8"}}
}]
(Ignore the neon green, it is for testing other hex values)
Because we don't want to use the top-level grey #77787B and berry #7B003F for a lot of the data, but it is useful for things like text boxes and KPIs to have at the front of the color picker in BI. So when we produce line charts, bar graphs, or really any data, we want to start automatically with the 3rd color, the blue at #3D6DA8.
When I apply a secondary y-axis though, it also defaults to the blue #3D6DA8.
If I instead write dataPoint as:
"dataPoint": [{
"defaultColor": { "solid": { "color": "dataColors"}}
I will get the secondary y-axis to automatically be a different color, but they are grey and berry, respectively.
Can I basically write a rule somehow in this JSON to say use the data colors, but not the first 2? Is there a way to do this in the JSON file?
I know manually formatting would be a lot easier, but we are trying to get this as automatic as possible and get it close to our brand standards that match other Microsoft products.
I am pretty inexperienced with coding, so I would appreciate any pointers, thanks!
Solved! Go to Solution.
Hi @SBusheyDewberry,
The 'datacolor' sets value will be used to assign colors to data bars of the chart that enabled the legends fields.
If you want to accurate setting specific visual styles, you can define the visual type in the theme file and set the properties.
Use report themes in Power BI Desktop - Power BI | Microsoft Docs
"visualStyles": {
"<visualName>": {
"<styleName>": {
"<cardName>": [{
"<propertyName>": <propertyValue>
}]
}
}
}
Notice:
1. Some of the properties have not been released and you can't configure them in theme files.
2. The dynamic generated and expand parts may not able to be set in themes.
Regards,
Xiaoxin Sheng
You can't handle the JSON theme dyanmically. You need to manually edit and use it in the file. Dynamic option is only applicable on the visual formatting color option which again can't stored as dynamic result in JSON.
Thanks
Hari
You can't handle the JSON theme dyanmically. You need to manually edit and use it in the file. Dynamic option is only applicable on the visual formatting color option which again can't stored as dynamic result in JSON.
Thanks
Hari
Hi @SBusheyDewberry,
The 'datacolor' sets value will be used to assign colors to data bars of the chart that enabled the legends fields.
If you want to accurate setting specific visual styles, you can define the visual type in the theme file and set the properties.
Use report themes in Power BI Desktop - Power BI | Microsoft Docs
"visualStyles": {
"<visualName>": {
"<styleName>": {
"<cardName>": [{
"<propertyName>": <propertyValue>
}]
}
}
}
Notice:
1. Some of the properties have not been released and you can't configure them in theme files.
2. The dynamic generated and expand parts may not able to be set in themes.
Regards,
Xiaoxin Sheng
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
26 | |
3 | |
2 | |
2 | |
2 |