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.
Hello,
A newly created visual comes with a static parseSettings method, which calls VisualSettings.parse(). If I inspect the return value of this call then it is a VisualSettings instance with a property called "dataPointSettings", which itself has properties like "defaultColor", "fontSize", etc. My question is where are these defined? I'd like to be able to modify these values but I can't find any class called VisualSettings in my source code.
Thank you.
Solved! Go to Solution.
Check "src/settings.ts" in your visual project.
Hi @callum @v-chuncz-msft
I'm also trying to develop a custom visual and is stuck at this particular point.
how did you retrieve property values from the dataview and how did you populate the property pane afterwards?
Did you use enumerateObjectInstances ?
Hello @Anonymous
Yes, you should implement enumerateObjectInstances in order to update values at the format panel.
Do you have VisualSettings class in your csutom visual?
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
hello @v-viig
Yes,I am using VisualSettings class.
Should i use the switch statement then.
I'm a little confused as this template is slightly different from the one in the tutorial.
If you want to include new properties into formatting panel you should:
export class NewGroup { public show: boolean = true; }
export class VisualSettings extends DataViewObjectsParser { public newGroup: NewGroup = new NewGroup(); }
"objects": { "newGroup": { "displayName": "New Group", "properties": { "show": { "displayName": "Show", "type": { "bool": true } } } } }
Please note that these steps are for including the new group of properties. You can actually include new properties into the existing classes (please don't forget to specify the same properties at capabilities.json).
Please let me know if you have any further questions.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Actually I have done upto here.Since now there is no need for an interface,How do I retrieve the property value from the pane.
Also how would this code snippet change after I add more properties?
public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstance[] | VisualObjectInstanceEnumerationObject { return VisualSettings.enumerateObjectInstances(this.settings || VisualSettings.getDefault(), options); }
You shouldn't change this snippet code.
All of properties will be parsed automatically.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
@v-viig
and how do i retrieve the property values from the pane?
are interfaces needed?
The property will in this.settings.
Do you want to include any extra properties?
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Check "src/settings.ts" in your visual project.
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 |
---|---|
12 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
23 | |
3 | |
2 | |
2 | |
2 |