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

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.

Reply
andiemcp13
Regular Visitor

Custom Power BI Visual: Format Panel Numeric Input Contraints

Hello, 

 

I am building a custom visual and have a property "Number of Decimal Places" that is a user input within the format panel.  With the latest FormattingModel utils API, I am using the "NumUpDown" Formatting Property and Numeric in the Capabilities Value Type.  In the microsoft documentation (https://learn.microsoft.com/en-us/power-bi/developer/visuals/custom-visual-develop-tutorial-format-o...) it suggests using the following code to constrain the values of a numeric input: 

this.visualSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualSettingsModel, options.dataViews);
this.visualSettings.circle.circleThickness.value = Math.max(0, this.visualSettings.circle.circleThickness.value);
this.visualSettings.circle.circleThickness.value = Math.min(10, this.visualSettings.circle.circleThickness.value);

However, the formatting panel does not seem to immediately update, you have to click into a different card before the value updates to the contrained value. Is there a method to update the format panel immediately after the code shown above to reflect the contraint? Or a different method to contrain the value within the getFormattingModel() method?

 

Thank you! 

0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.