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.
In capabilities.json, I added the code below, as per the docs:
"supportsHighlight": true
However, the custom visual is still receiving pre-filtered data, regardless of the interaction setting between visuals, and there is no "highlights" property anywhere in the data view object or any of its children objects.
I've tried APIs 1.5 and 1.6. The visual is using series grouping.
Is this feature broken at the moment?
Or is there a new way of declaring support for highlighting and the docs are lagging?
Or am I missing something really obvious and need to get new glasses?
Thanks.
That's the thing - the values are coming pre-filtered and the highlights array is nowhere to be found, so there's nothing for the visual to work with, It's as if the API is ignoring the setting altogether.
Better to share your capabilities.json here. I can see the highlights array by options.dataViews[0].categorical.values[0].highlights.
Below is the full capabilities.json file.
I'm wondering if any of the query behaviour I'm requesting is breaking the highlight functionality in some way.
Or perhaps I need to do something extra that main docs don't mention?
I've tried different setups but nothing is triggering the highlight behaviour - i.e. getting the full unfiltered data back and a highlight array anywhere in data view object tree that I can use.
Interestingly, when editing interactions on a report, the little pie-chart-like "give me a highlight" switch does show up on top of the custom visual, indicating Power BI is recognizing the setting in the capabilities.json file. It just doesn't do anything about it and still pre-filters data based on other visual's selections, regardless of the switch being selected or not.
Thanks for looking into this.
{ "supportsHighlight": true, "dataRoles": [ { "displayName": "Axis", "name": "axis", "kind": "Grouping" }, { "displayName": "Series", "name": "series", "kind": "Grouping" }, { "displayName": "Lines", "name": "lines", "kind": "Measure" }, { "displayName": "Values", "name": "values", "kind": "Measure" } ], "dataViewMappings": [ { "conditions": [ { "axis": { "max": 1 } }, { "series": { "max": 1 } }, { "values": { "max": 1 } } ], "categorical": { "categories": { "for": { "in": "axis" }, "dataReductionAlgorithm": { "sample": {} } }, "values": { "group": { "by": "series", "select": [ { "bind": { "to": "values" } }, { "bind": { "to": "lines" } } ] } } } } ], "objects": { "yAxis": { "displayName": "Y Axis", "properties": { "scaleType": { "displayName": "Scale Type", "type": { "enumeration": [ { "displayName": "Linear", "displayNameKey": "Linear", "value": "Linear" }, { "displayName": "Log", "displayNameKey": "Log", "value": "Log" } ] } }, "position": { "displayName": "Position", "type": { "numeric": true } } } }, "xAxis": { "displayName": "X Axis", "properties": { "format": { "displayName": "Format Mask", "type": { "text": true } }, "rotation": { "displayName": "Rotation", "type": { "numeric": true } }, "position": { "displayName": "Position", "type": { "numeric": true } }, "ticks": { "displayName": "Ticks", "type": { "numeric": true } } } }, "seriesShapes": { "displayName": "Series Shapes", "properties": { "shape": { "displayName": "Shape", "type": { "enumeration": [ { "displayName": "Regular", "displayNameKey": "Regular", "value": "Regular" }, { "displayName": "Vertical Line", "displayNameKey": "VerticalLine", "value": "VerticalLine" } ] } } } }, "colorSelector": { "displayName": "Data Colors", "properties": { "fill": { "displayName": "Color", "type": { "fill": { "solid": { "color": true } } } } } } } }
You need to loop through the array options.dataViews[0].categorical.values to find the highlights array.
As I keep saying, there is no highlights array anywhere in the dataview object tree to be seen, in that location, its children, its parents, the "grouped" object for series data, or any other location. It's just not there.
And the data itself is coming through pre-filtered by power bi, so the highlights array would have no use, even if it did show up.
This functionality is simply not working with this setup to start with.
Are the docs on GitHub up to date, do you know?
Perhaps there's another magic switch or a new API I need to use?
As far as I know, this is the only available API. I just replace the capabilities.json of Sample Bar Chart Repo with yours, and I can see the highlights array.
So it appears to work between custom visuals on the latest API, but other scenarios fail.
For example:
Trigger | Target | Result | Notes |
Vanilla Bar Chart | Custom Visual (API 1.6) | OK | Power BI enables the highlight option in the custom visual and the dataview highlights array shows up. |
Vanilla Slicer | Custom Visual (API 1.6) | KO | Power BI does not enable the highlight button in the target custom visual to start with. |
Chiclet Slicer (API 1.5) | Custom Visual (API 1.6) | KO | Power BI enables the highlight button, however it still filters the data regardless of its selection and the highlights array does not show up. |
Custom Visual (API 1.6) | Custom Visual (API 1.6) | OK | Power BI enables the highlight option in the custom visual and the dataview highlights array shows up. Highlighting data only makes sense if the SelectionIds between visuals are compatible, which is OK. |
Anyway, this is now under premier support as it has become a blocker.
I'll share any relevant solution back here once we know more.
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 |
---|---|
13 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
20 | |
3 | |
2 | |
2 | |
2 |