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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
LortT
Frequent Visitor

How to disable setting with toggle switch

Hello everyone,

I created a custom visuals and I see that Robbon Chart can toggle the switch above to disable the color below. When the switch is on, I cannot select the color, but when it is off, I can select the color. I want to ask how to do that with code, can anyone show me a sample code or link to instructions on how to do this? Below is an illustrative example image 

LortT_0-1729219736181.png

LortT_2-1729220061264.png

 

 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi  ,Base on my description, it seems like you want to disable setting with toggle switch in custom visual. Then you'll need to modify the capabilities.json file and the visual's code.

Solved: Format Panel Toggle Switch to Reveal More Options - Microsoft Fabric Community

First ensure that your objects are all configured up in your capabilities.json and they have a corresponding setting object so that they appear in the pane.

If we start with a new visual, I've added these to the capabilities under the dataPoint object:

"toggle": {
"displayName": "Show my Property",
"type": {
"bool": true
}
},
"hideOnToggle": {
"displayName": "I Get Hidden if This Works",
"type": {
"text": true
}
}​

I'll add a couple of extra properties to the dataPointSettings class in settings.ts, e.g.:

// Test toggle
public toggle: boolean = true;
// Should hide if toggle off
public hideOnToggle: string = 'Hiya!';
}

Best Regards

 

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

View solution in original post

1 REPLY 1
v-yiruan-msft
Community Support
Community Support

Hi  ,Base on my description, it seems like you want to disable setting with toggle switch in custom visual. Then you'll need to modify the capabilities.json file and the visual's code.

Solved: Format Panel Toggle Switch to Reveal More Options - Microsoft Fabric Community

First ensure that your objects are all configured up in your capabilities.json and they have a corresponding setting object so that they appear in the pane.

If we start with a new visual, I've added these to the capabilities under the dataPoint object:

"toggle": {
"displayName": "Show my Property",
"type": {
"bool": true
}
},
"hideOnToggle": {
"displayName": "I Get Hidden if This Works",
"type": {
"text": true
}
}​

I'll add a couple of extra properties to the dataPointSettings class in settings.ts, e.g.:

// Test toggle
public toggle: boolean = true;
// Should hide if toggle off
public hideOnToggle: string = 'Hiya!';
}

Best Regards

 

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.