Forum Discussion

Krunalbpatel's avatar
Krunalbpatel
Helper III
9 years ago
Solved

Create Custom visuals - Set bar color

Hi,   I am creating a custom Bar chart. I want to change the bar color from the color palette. Each bar should have a different color based on selection.   let colors = createColorPalette(host.co...
  • v-chuncz-msft's avatar
    v-chuncz-msft
    9 years ago

    Krunalbpatel,

     

    Things have changed. Re-download the Sample Bar Chart Repo, and modify barChart.ts as shown below.

        interface BarChartDataPoint {
            value: PrimitiveValue;
            category: string;
            color: string;
            selectionId: powerbi.visuals.ISelectionId;
        };
    selector: barDataPoint.selectionId.getSelector()