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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.