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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
swamisharma
New Contributor

Color Picker without color palette, need to have only conditional formatting button

Hello All,
I am currently working on custom visual formatting pane to add a color picker without the color palette button (color dropdown next to `fx` button), just need to have conditional formatting button (this fx button)
Current UI looks like

swamisharma_0-1753871634450.png

Expected (This is from Table visual > Format Pane > Cell Element Card)

swamisharma_1-1753871695632.png

I am currently using "Color Picker slice"

and this is my code in capabilities

"objects": {
        "values": {
            "properties": {
               "conditionalColor": {
                    "type": {
                        "fill": {
                            "solid": {
                                "color": true
                            }
                        }
                    }
                }
            }
        }
    }

 

3 REPLIES 3
dm-p
Honored Contributor

Hi @swamisharma,

 

When you set up conditional formatting, you specify a VisualEnumerationInstanceKinds enum value as part of the properties. This should be set to Rule if you only wany the button and not the typical element rendered for the property.

 

If you are trying this and it doesn't work you will need to create a support issue, as it will be a bug.

 

Regards,

 

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




swamisharma
New Contributor

Hello @dm-p ,
We are already using the same enum while creating slices in formatting pane
Please refer the code attached

conditionalColor = new formattingSettings.ColorPicker({
        name: "conditionalColor",
        displayName: "Color",
        value: { value: undefined },
        altConstantSelector: null,
        instanceKind: powerbi.VisualEnumerationInstanceKinds.Rule,
        selector: dataViewWildcard.createDataViewWildcardSelector(dataViewWildcard.DataViewWildcardMatchingOption.InstancesAndTotals)
});

Can you please share how to create a support ticket?

dm-p
Honored Contributor

That looks correct. I've just tried it myself, and it might be a quirk of how the powerbi-visuals-utils-formattingmodel classes abstract a lot of the work away and handle the rendering of the newer formatting pane components. I confess, the last time I wanted this specific situation was before these utilities were made available, and you had to construct the formatting model using the visual host directly.

 

I would indeed suggest asking the custom visuals team for an example they can give you. You can contact them at pbicvsupport@microsoft.com

 

Best of luck (and if you get a workable example, it would be great to know if it's possible!),

 

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
Top Solution Authors
Users online (11,586)