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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors