PowerBI主题制作

简单主题:

{
    "name": "St Patricks Day",
    "dataColors": ["#568410", "#3A6108", "#70A322", "#915203", "#D79A12", "#bb7711", "#114400", "#aacc66"],
    "background":"#FFFFFF",
    "foreground": "#3A6108",
    "tableAccent": "#568410"
}

复杂的全局主题:

{
"name": "test",
    "dataColors": ["#568410", "#3A6108", "#70A322", "#915203", "#D79A12", "#bb7711", "#114400", "#aacc66"],
    "background":"#915203",
    "foreground": "#FFFFFF",
    "tableAccent": "#568410",
	
	"visualStyles": {
        "*": {
            "*": {
                "title": [{
                    "show": true,
                    "fontColor": { "solid": { "color": "#FFFFFF" } }, 
                    "alignment": "center",
                    "fontSize": 14,
                    "fontFamily": "Verdana"
                }],
				"*":[{
					"fontColor":{ "solid": { "color": "#FFFFFF" } }
				}]
			}
		},
		"tableEx": {  
			"*": {
				"grid": [{
					"gridVertical": true,
					"gridVerticalColor": { "solid": { "color": "#3A6108"}},
					"gridVerticalWeight": 2,
					"gridHorizontal": true,
					"gridHorizontalColor": { "solid": { "color": "#3A6108"}},
					"gridHorizontalWeight": 2,
					"rowPadding": 2,
					"outlineColor": { "solid": { "color": "#3A6108"}},
					"outlineWeight": 2,
					"textSize": 14,
					"imageHeight": 100
				}],
				"columnHeaders": [{ 
					"fontColor": { "solid": { "color": "#FFFFFF"}}, 
					"backColor": { "solid": { "color": "#3A6108"}}, 
					"outline": "Frame",
					"autoSizeColumnWidth": true,
					"fontSize": 12,
					"alignment": "Left",
					"wordWrap": true
				}],
				"values": [{  
					"fontColorPrimary": { "solid": { "color": "#FFFFFF"}},  
					"backColorPrimary": { "solid": { "color": "#3A6108"}},  
					"fontColorSecondary": { "solid": { "color": "#FFFFFF"}}, 
					"backColorSecondary": { "solid": { "color": "#3A6108"}}, 
					"outline": "Frame",
					"urlIcon": true,
					"wordWrap": true,
					"fontSize": 11
				}]
			}		
		},
		"page": {
            "*": {
                "background": [{
                    "color": { "solid": { "color": "#A1740E" } },
                    "transparency": 50
                }],
                "outspace": [{
                    "color": { "solid": { "color": "#8DBFE8" } },
                    "transparency": 50
                }]
            }
        }
	}
}

 

参考资料:https://zhuanlan.zhihu.com/p/42996993

如果需要对每一个图表(可视化对象)进行设置,可以去github上看示例,这个项目有所有的图表设置的例子:

 

posted @ 2018-10-25 23:33  逍客1  阅读(1563)  评论(0编辑  收藏  举报