The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a json theme file in which I added "Light Mode Preset" and "Dark Mode Preset". I was thinking "name": "Light Mode Preset" was to define what I want as the default setting? Currently the default seems to be the Power BI default. What do I need to do to make the default - "Light Mode Preset"?
My JSON:
"columnChart": {
"*": {
"stylePresets": [
{
"name": "Light Mode Preset"
}
]
},
"Light Mode Preset": {
"legend": [
Solved! Go to Solution.
hI @andy808 ,
Thank you for the update!Glad it worked! Consider accepting your answer as solution,so other members in the community can easily find it.
Thanks again for your cooperation.Have a great day!
Hi @andy808 ,
I would like to confirm whether you have successfully resolved the issue .
If the issue has been resolved, please mark the helpful reply as a "solution" to indicate that the question has been answered and to assist others in the community.
Thank you for your cooperation. Have a great day.
Hi @andy808 ,
I would like to confirm whether you have successfully resolved the issue .
If the issue has been resolved, please mark the helpful reply as a "solution" to indicate that the question has been answered and to assist others in the community.
Thank you for your cooperation. Have a great day.
Hi @andy808 ,
Has the issue been resolved on your end? If so, please share your solution and mark it as "Accept as Solution." This will assist others in the community who are dealing with similar problems and help them find a solution more quickly.
Thank you.
Hello @andy808,
Can you please try this approach:
"visualStyles": {
"columnChart": {
"*": {
"stylePresets": [
{
"name": "Light Mode Preset"
},
{
"name": "Dark Mode Preset"
}
]
},
"Light Mode Preset": {
"legend": {
// styling
}
},
"Dark Mode Preset": {
"legend": {
// styling
}
}
}
}
Thank you for your response but there is no change in behavior. This is what I tried:
"columnChart": {
"*": {
"stylePresets": [
{
"name": "Light Mode Preset"
},
{
"name": "Dark Mode Preset"
}
]
},
"Light Mode Preset": {
"legend": [
{
Hi @andy808 ,
Thank you for sharing the updated JSON and clarifying the issue and thank you @Sahir_Maharaj for the helpful response!
Power BI does not automatically apply a named preset as the default. Instead, it uses the settings under the "*" section as the default style for all visuals of that type.In this case, columnChart.
To apply your Light Mode styling by default,try using below :
"visualStyles": {
"columnChart": {
"*": {
"legend": {
// Example Light Mode
"show": true,
"position": "Top",
"fontColor": { "solid": { "color": "#000000" } }
},
"stylePresets": [
{ "name": "Light Mode Preset" },
{ "name": "Dark Mode Preset" }
]
},
"Light Mode Preset": {
"legend": {
// Keep your Light Mode settings here for manual use
}
},
"Dark Mode Preset": {
"legend": {
// Dark Mode settings
}
}
}
}
This way, the Light Mode style is applied by default, and users can still switch to the Dark Mode preset manually in the Format pane if required.
Hope this resolve your query.If so,consider accepting it as solution.
Thank you.
Regards,
Pallavi.
Thanks Pallavi! That does work. From Microsoft documentation it seemed a bit more straight forward, but its not. Thanks again.
hI @andy808 ,
Thank you for the update!Glad it worked! Consider accepting your answer as solution,so other members in the community can easily find it.
Thanks again for your cooperation.Have a great day!