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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jazfunk
Frequent Visitor

Add context menu to modified bulletchart visual

I've successfully modified the MS BulletChart visual to achieve seven bands, instead of four, and some other items.  Now, I want to add context menu support (right-click) and I'm having the hardest time implementing this.

 

After following the documentation I'm getting errors on the "eventTarget" portion of this:

 

this.svg.on('contextmenu', () => {
            const mouseEvent: MouseEvent = d3.event as MouseEvent;
            const eventTarget: EventTarget = mouseEvent.target;
            let dataPoint = d3.select(eventTarget).datum();
            this.selectionManager.showContextMenu(dataPoint? dataPoint.selectionId : {}, {
                x: mouseEvent.clientX,
                y: mouseEvent.clientY
            });
            mouseEvent.preventDefault();
        });

 

This bullet chart is so complex, that nothing seems to match up with any documentation I'm seeing.  I'm surprised this visual didn't already come equipped to handle a context menu.  The drill-down roles support is listed in the capabilities.json.

 

Looking for some guidance on how to get this accomplished.

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @jazfunk ,

 

Add context menu to Power BI Visual in Power BI embedded analytics for better embedded BI insights -...

Maybe you can refer to the link.

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-lionel-msft  thank you for your input, however, this is the same link I posted in my question, and the one in which I used to attempt to implement this feature.  This produces errors, as written.  The error states that "no overload matches this call".

Again, thanks for the input.

 

jazfunk_0-1617627979827.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.