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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
holly3012
New Member

Updating custom visual formatting pane with text input

Hi - I'm making a custom scatterplot visual and as I have updated to API 5.1, I have replaced my enumerate function with a formatting model. I want to have a text input for my x and y axis labels in my formatting pane. I keep getting an error when putting in the value in my formatting function.. I'm only having this problem for text inputs and everything else seems to work fine.

 

This is my code below.

 

 {
          displayName: "X Axis Label",
          uid: "xAxisLabel_uid",
          control: {
            type: powerbi.visuals.FormattingComponent.TextInput,
            properties: {
              descriptor: {
                objectName: "axes",
                propertyName: "xAxisLabel",
              },
              value:  this.settings.axes.xAxisLabel,
            },
          },
        },
 
I've also tried value: {value: this.settings.axes.xAxisLabel} but I'm still getting the same issue. 
 
The error message: Type 'string' is not assignable to type 'ControlType<SimpleComponentType>'
 
Any help would be much appreciated! Thank you!
4 REPLIES 4
v-jianboli-msft
Community Support
Community Support

Hi @holly3012 ,

 

Each formatting property in the formatting model needs a corresponding object in the capabilities.json file. The formatting property should contain a descriptor with an object name and property name that exactly match the corresponding capabilities object (the object and property names are case sensitive).

The following table shows the formatting property types in capabilities.json file and their matching type class in modern formatting model properties, please check: Visualization pane formatting properties 

 

For more details, please refer to:

Customize the format pane in Power BI custom visuals - Power BI | Microsoft Learn 

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

My capabilities match to the corresponding property types, it is just when I try to use a TextInput that I am getting an error...

Hi Holly, 

Did you ever resolve this?  I'm running into a similar issue.

I had this error too and fixed it by adding a placeholder property: 

SanderGi_0-1688097602482.png

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.