Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
Is it possible to do this? For example to set the background of my visual, I've tried the following:
#sandbox-host{
background:black;
}but it has no effect.
Strangely enough, in the visual's TypeScript I can set it with d3 like
d3.select(this.host).style("background", "black");so it is possible to style it, just not via pure CSS it seems.
Am I doing something wrong?
Solved! Go to Solution.
This issue is related to the fact that PBIVIZ tools encapsulate CSS by including GUID of the visual as a prefix for all of selectors.
Our recommendation is to include an extra DOM element and apply styles to this element.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
inside constructor make one HTML element as below:
inside visual.less file add,
I've just discovered that it's even possible to set it via d3 with
d3.select("#sandbox-host").style("background", "black");so it can't be an issue with the syntax or spelling of the selector I'm using...
This issue is related to the fact that PBIVIZ tools encapsulate CSS by including GUID of the visual as a prefix for all of selectors.
Our recommendation is to include an extra DOM element and apply styles to this element.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |