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.
I'm hoping someone can help me.
I'm developing a custom visual and in the code of the custom visual, I'd like to be able to import a custom theme's json file. I'm trying to expose the custom theme's properties to my custom visual's code. But at the moment, I have no idea how to "find" or "access" the theme json file directly from the code in my custom visual.
Anyone have any ideas how to do this? Thanks in advance!
Hi @robbieinoz - just curious... why wouldn't you configure your theme file with your custom visual properties so you (or users) can style it the conventional way?
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hi @robbieinoz ,
That's a pretty cool idea, and I've often wondered how a few vendors do it...I've considered how to implement license generation/validation for visuals (I notice that Zebra BI don't validate against an external server either so they probably have a similar mechanism) but it's something that isn't easy to discover, so I'm sticking with doing mine as open source for now 😛
The theme file is quite an interesting idea, particularly to manage at a report level.
If I had to take a guess at it, they'll probably have one or more objects in the capabilities that are hidden when the visual objects are enumerated, but can still have a default value provided via theme config, and this is how it's managed. This could then be obtained from the visual settings in the usual way.
I'm doing a massive update to one of my visuals and have put some effort into figuring out how to add styling to the theme, which may give you some assistance. This page is still in progress in a dev branch, but it might give you some ideas on how to populate a property via styling by adding your visual's ID to the file.
Not sure if it'll help, but I hope it does. Good luck!
Daniel
EDIT: corrected link to actual page in repo
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hi @robbieinoz - sounds good! Feel free to get in touch if you want me to take a look or get stuck and I'll see if I can offer any further help.
Cheers,
Daniel
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
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 |
---|---|
14 | |
2 | |
2 | |
1 | |
1 |