Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I am just trying to be consistent with synchronizing the colors of data points from my custom visual with the other 'out of the box' pbi visuals. I am using the code snippet from the documentation to assign colors to my data points:
let colorPalette: IColorPalette = host.colorPalette; // host: IVisualHost for (let i = 0, len = Math.max(category.values.length, dataValue.values.length); i < len; i++) { barChartDataPoints.push({ category: category.values[i], value: dataValue.values[i], color: colorPalette.getColor(category.values[i]).value, }); }
Some of the time the data points from my visual are the same as other visuals and other times they are not.
My question is, does all the visuals in the pbi dashboard pull from the same host.colorPalette object? If so what determines which hex color gets assigned to each data point in the object? Why are the colors assigned to my data points in the colorPalette object different from other visuals that are displaying the same data points. Is there a way from your data points to always get assigned the same colors as others visuals. I have read the documentation https://microsoft.github.io/PowerBI-visuals/docs/how-to-guide/adding-colors-to-your-visual/
Thanks!
Matt
Even I am having the same issue. When increasing the data with slicer the colors are getting repeated.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
3 | |
3 | |
3 | |
2 | |
2 |