Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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.colors).reset()
But I am getting the error --> "Property 'colors' does not exist on type 'IVisualHost'"
and also
selector: barDataPoint.selectionId.getSelection()
I am getting the error --> " Property 'getSelection' does not exist on type 'ISelectionId'"
Solved! Go to Solution.
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()
The API Version has been updated to 1.3.0. Based on my test, you may refer to the following corresponding code snippet.
let colorPalette: IColorPalette = host.colorPalette;
selector: barDataPoint.selectionId.getSelector()
Hi @v-chuncz-msft,
I am using this code also but I am getting the following error
error TYPESCRIPT /src/visual.ts : (82,13) Type 'powerbi.extensibility.IColorPalette' is not assignable to type 'power
bi.extensibility.visual.PBI_CV_8D244A15_FCEE_4355_A23C_3E763013AF73.IColorPalette'.
Property 'reset' is missing in type 'IColorPalette'.
And This error has been resolved by changing
selector: barDataPoint.selectionId.getSelector()
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()
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |