Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Adding drillthrough to existing visual

Hi Folks

 

I have the following source code: GANTT 

 

I tried to understand, where and how I could a drillthrough option to it.

 

Do any of you maybe a tipp, on where I should add it, or if it is even possible, without rewriting the whole project?

 

Thanks in advance for your tips and help

 

1 REPLY 1
dm-p
Super User
Super User

Hi @Anonymous,

Did you try asking MAQ if they could add the feature? It might take a while but that might be your best bet if you're not looking to develop.

If you do want to try developong this yourself, I've had a quick look through their source code and it looks like they are using a fairly standard approach of handling the visual's behaviour using one of the utilities provided by the Custom Visuals Team.

Their implementation is not quite the same as the linked doc but it is the same approach and I would start here first.

It should be possible to adapt the code to bind a contextmenu event using something similar to the code in step 6 of this walkthough on the same page.

I don't have the capacity at present to check-out their code and test in situ but I would start with amending bindEvents in src/behavior.ts as follows:

public bindEvents(options: IGanttBehaviorOptions, selectionHandler: ISelectionHandler): void {
    this.options = options;
    this.selectionHandler = selectionHandler;
    options.taskSelection.on("click", (d: SelectionDataPoint) => {
        selectionHandler.handleSelection(d, (d3.event as MouseEvent).ctrlKey);
        (d3.event as MouseEvent).stopPropagation();
    });
    /* -- START OF CHANGES -- */
    options.taskSelection.on("contextmenu", (d: SelectionDataPoint) => {
        const event = (d3.event as MouseEvent);
        selectionHandler.handleContextMenu(d, { x: event.clientX, y: event.clientY });
        event.stopPropagation();
    });
    /* -- END OF CHANGES -- */
}

However this will depend on what context they are assigning to the selectable data points in the visual - if you want to drillthrough on the same column they're using then you should get the context menu displayed with an option to drill through.

If the context menu appears but there's no drillthrough, then it's highly likely that the selection ID applied to the element is not what you need. If this is the case, then you'll need to provide us with more details - ideally some representative data for your use case and we can take another look at it

Good luck,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.