Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
23 | |
3 | |
2 | |
2 | |
2 |