Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
superspandl
Frequent Visitor

How to read theme values. in custom visuals

Hello,

 

I'm trying to get the values from a theme within a custom visual.

 

I can get the color settings with the `ColorHelper`, but how can I get values about font family, size, and colors?

 

If I look into this sample theme:

https://gist.github.com/gonz4lex/7097bc0a7c6b40a7067a065965ad6414

or
https://github.com/mattrudy/PowerBI-ThemeTemplates/blob/master/GlobalLevelTemplate.json

 

Multiple values could be defaults for custom visuals (color, font family, alignment for labels and titles, even background color, transparency, or border radius).

 

Two questions:

1. Is there a way to get them with the API?

2. Are all these properties also present in the default theme?

 

Thanks

ralph

 

1 REPLY 1
superspandl
Frequent Visitor

After some more research, I have the impression that there is no way to initialize a chart with values from the theme.

 

  1. Color values are not passed to the constructor. 
  2. Colors could be set the first time the update method runs, however, the colors would then be set and a change on the theme wouldn't have any impact on the chart
  3. The reset to default settings would not have the same result as creating the chart

It seems that the concept of themes isn't integrated into PBI custom visuals.

 

Could confirm my theory?

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors