Forum Discussion
Custom Visualization additional DataViewCategoryColumn
You should use group-by Category to group values. In such case you will be able to generate a proper SelectionId.
"values": {
"group": {
"by": "Paths",
"select":[
Please have a look at this example.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
I believe this is how I've got it right now, with the group by (See gist in previous post).
With it I get the right values, but I want to enumerate and set colors per group (Which are the pie slices).
Can I build the selectors the same way when enumerating the different series? (For the pie slices coloring)
For the moment, I've been playing with this function.. but i dont know if I'm in the right path:
case "stackColorsFormatting":
var metadataColumns2: DataViewMetadataColumn[] = this.dataView.metadata.columns.filter( function(d) { if (d.groupName) { return true; } } );
for (let barDataPoint of metadataColumns2) {
console.log("create selection id?");
objectEnumeration.push({
objectName: objectName,
displayName: barDataPoint.groupName.toString(),
properties: {
fill:this.getArcColor<object>(barDataPoint.objects,objectName,"fill",null)
},
selector: { id: this.host.createSelectionIdBuilder().withSeries( this.dataView.categorical.values,this.dataView.categorical.values[0] ).createSelectionId().getKey() }
});
}
break;
- v-viig8 years agoCommunity Champion
GGimenez Could you please share source code to make some changes?
You can send code to [email protected].
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals