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.
Hi
Does anyone have a clue to fetch the color formatting picker color based on theme change?
We have a custom color formatting option to change the particular div background in our custom visual, by default the PowerBI document .pbix file having a default theme while fetching the color from picker it retrieved proper solid color.
But after changing the premade theme of PowerBI like electric, it not retrieve the proper color code. It retrieves only the solid Theme color 9.
capabilities.json configuration
"background": {
"displayName": "Background Color",
"type": {
"fill": {
"solid": {
"color": true
}
}
}
}
Formatting value fetching by,
let backgroundProperty: DataViewObjectPropertyIdentifier = {
objectName: objectName,
propertyName: "background"
};
var background = DataViewObjects.getValue<object>(objects, backgroundProperty, { "solid": { "color": "#FFFFFF" } });
@Anonymous,
You may take a look at the following posts.
Yes, the theme colors are updated based on the selected theme, but while fetching the color code through the custom visual with the below-mentioned config of capabilities.json it retrieved only the solid(default theme) color code.
e.g, after changed the theme, the selected color is #F64F5C but in visual it retrieved the color code only from the default theme color palette - #FE9666
"background": {
"displayName": "Background Color",
"type": {
"fill": {
"solid": {
"color": true
}
}
}
}
I am facing the exact same problem. Did you ever manage to find a solution for this. In my format pane, when i want to choose a color for my barplot it shows the correct color for the current theme, but it gives the hex color code for the classic theme. So if I select Theme color 1 for my current theme, so square which I click on is the correct color, but when it loads on to my custom visual it uses Theme color 1 from the "classic" power BI theme no matter what theme i select.
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 |
---|---|
115 | |
99 | |
88 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |