Forum Discussion
Anonymous
3 years agoNot applicable
Problems with host.colorPalette not picking theme colors
Hello community, I am trying to implement colors in my custom visual. So far it is looking really good, however I have troubles with the coloring. Everything works fine, if the visual is adde...
Anonymous
3 years agoNot applicable
I had to update my dataViewMappings to support more columns. It now looks like this:
"dataRoles": [
{
"displayName": "Reporting Date",
"name": "date",
"kind": "Grouping"
},
{
"displayName": "Milestone Date",
"name": "milestoneDate",
"kind": "Measure"
},
{
"displayName": "Milestone Name",
"name": "milestone",
"kind": "Grouping"
},
{
"displayName": "Project Name",
"name": "project",
"kind": "Grouping"
}
],
"dataViewMappings": [
{
"categorical": {
"categories": {
"select": [
{
"for": {
"in": "date"
}
},
{
"for": {
"in": "project"
}
},
{
"for": {
"in": "milestone"
}
}
]
},
"values": {
"for": {
"in": "milestoneDate"
}
}
}
}
]
and setting the selectionId like this:
const values = dataViews[0].categorical.values[0].values;
const col_project = dataViews[0].categorical.categories[index_project];
//...
values.forEach((value, i) => {
//...
project[index].selectionId = host.createSelectionIdBuilder().withCategory(col_project, i).createSelectionId();
//...
}
Unfortunately the problem from my previous post persists.
Furthermore, when selecting a category by clicking on it in my legend all other visuals notice a selection, but all categories in those visuals getting "unhighlited" / half-transparent, as if a category which doesnt exists is selected. I must be doing something wrong while creating the selction?
Selecting via onClick:
host.createSelectionManager().select(viewModel.projects[i].selectionId);
Again, thank you for any pointers of code examples 🙂