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
Anonymous
Not applicable

Display ColorPickers for all categories

Hello,

 

How to display ColorPicker for each entry of data array in React ?

 

In visual.tsx I have this :

 

 

 

public getFormattingModel(): powerbi.visuals.FormattingModel {
    return this.formattingSettingsService.buildFormattingModel(
      this.formattingSettings
    );
}

 

 

 

I have a settings.ts file like this :

 

 

 

class CategoryColorsCardSettings extends FormattingSettingsCard {
  categoryColor = new formattingSettings.ColorPicker({
    name: "fill",
    displayName: ,
    value: { value:  },
    selector: dataViewWildcard.createDataViewWildcardSelector(
      dataViewWildcard.DataViewWildcardMatchingOption.InstancesAndTotals
    ),
    altConstantSelector:,
    instanceKind: powerbi.VisualEnumerationInstanceKinds.ConstantOrRule,
  });

  name: string = "categoryColors";
  displayName: string = "Category colors";
  slices: Array<FormattingSettingsSlice> = [
    this.categoryColor
  ];
}

export class VisualFormattingSettingsModel extends FormattingSettingsModel {
  categoryColorsCard = new CategoryColorsCardSettings();
  cards = [this.categoryColorsCard];
}

 

 

 

I don't know how to put parameters to VisualFormattingSettingsModel class in order to fill displayName, value and altConstantSelector fields. In update method I have this :

 

 

 

this.formattingSettings =
    this.formattingSettingsService.populateFormattingSettingsModel(
       VisualFormattingSettingsModel,
       options.dataViews
    );

 

 

 

Thanks for help.

0 REPLIES 0

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (27)