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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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!


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




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.