创建一个 Power BI JSON 主题时,嵌入时,如何定位 “Wallpaper” 颜色?

huangapple go评论68阅读模式
英文:

Building a Power BI JSON theme while embedding, how do I target "Wallpaper" color?

问题

我正在尝试构建一个Power BI JSON主题,用于嵌入Power BI报告时。如何定位这个属性"Wallpaper"?

我尝试过这个,但似乎没有改变它。

{
    "visualStyles": {
        "page": {
            "*": {
                "background": [
                    {
                        "color": {
                            "solid": {
                                "color": "#121212"
                            }
                        },
                        "transparency": 0
                    }
                ],
                "wallPaper": [
                    {
                        "color": {
                            "solid": {
                                "color": "#121212"
                            }
                        },
                        "transparency": 0
                    }
                ]
            }
        },
        "*": {
            "*": {
                "*": [
                    {
                        "fontFamily": "Segoe UI",
                        "color": { "solid": { "color": "#252423" } },
                        "labelColor": { "solid": { "color": "#FFFFFF" } },
                        "secLabelColor": { "solid": { "color": "#FFFFFF" } },
                        "titleColor": { "solid": { "color": "#FFFFFF" } }
                    }
                ],
                "labels": [
                    {
                        "color": { "solid": { "color": "#FFFFFF" } }
                    }
                ],
                "categoryLabels": [
                    {
                        "color": { "solid": { "color": "#FFFFFF" } }
                    }
                ],
                "border": [
                    {
                        "show": true,
                        "color": { "solid": { "color": "#484644" } },
                        "radius": 2
                    }
                ],
                "dropShadow": [
                    {
                        "color": {
                            "solid": {
                                "color": "#FFFFFF"
                            }
                        },
                        "show": true,
                        "position": "Outer",
                        "preset": "Custom",
                        "shadowSpread": 1,
                        "shadowBlur": 1,
                        "angle": 45,
                        "shadowDistance": 1,
                        "transparency": 95
                    }
                ]
            }
        }
    }
}
英文:

I'm trying to build a Power BI JSON theme, when embedding a Power BI report. How do I target this property "Wallpaper"?

创建一个 Power BI JSON 主题时,嵌入时,如何定位 “Wallpaper” 颜色?

I tried this, but does not seem to change iot.

{
    "visualStyles": {
        "page": {
            "*": {
                "background": [
                    {
                        "color": {
                            "solid": {
                                "color": "#121212"
                            }
                        },
                        "transparency": 0
                    }
                ],
                "wallPaper": [
                    {
                        "color": {
                            "solid": {
                                "color": "#121212"
                            }
                        },
                        "transparency": 0
                    }
                ]
            }
        },
        "*": {
            "*": {
                "*": [
                    {
                        "fontFamily": "Segoe UI",
                        "color": { "solid": { "color": "#252423" } },
                        "labelColor": { "solid": { "color": "#FFFFFF" } },
                        "secLabelColor": { "solid": { "color": "#FFFFFF" } },
                        "titleColor": { "solid": { "color": "#FFFFFF" } }
                    }
                ],
                "labels": [
                    {
                        "color": { "solid": { "color": "#FFFFFF" } }
                    }
                ],
                "categoryLabels": [
                    {
                        "color": { "solid": { "color": "#FFFFFF" } }
                    }
                ],
                "border": [
                    {
                        "show": true,
                        "color": { "solid": { "color": "#484644" } },
                        "radius": 2
                    }
                ],
                "dropShadow": [
                    {
                        "color": {
                            "solid": {
                                "color": "#FFFFFF"
                            }
                        },
                        "show": true,
                        "position": "Outer",
                        "preset": "Custom",
                        "shadowSpread": 1,
                        "shadowBlur": 1,
                        "angle": 45,
                        "shadowDistance": 1,
                        "transparency": 95
                    }
                ]
            }
        }
    }
}

答案1

得分: 1

使用Power BI Desktop定制当前主题快速简便。按照在Power BI Desktop中使用报表主题 - Power BI | 微软学习中的步骤操作。您可以保存和导出自定义主题的JSON。

获得自定义主题的JSON对象后,可以在加载时通过在embedConfig中传递主题或在运行时使用applyTheme API将主题应用于报表。

参考:

在Power BI嵌入式分析应用程序中应用报表主题 - 微软学习

英文:

Customizing the current theme using Power BI Desktop is fast and simple. Follow the steps in Use report themes in Power BI Desktop - Power BI | Microsoft Learn. You can save and export json for customized theme.

Once you get the JSON object for customized theme, you can apply theme to report either at load time by passing theme in embedConfig or apply theme to report at runtime using applyTheme API.

References:

Apply report themes in a Power BI embedded analytics application | Microsoft Learn

huangapple
  • 本文由 发表于 2023年2月27日 14:54:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/75577487.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定