cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Custom visual tool-tips for line chart

I'm creating a custom visual which has a line chart with multiple lines. How to create the tool-tip similar to power bi native line chart? I have created simple tool-tips for bar charts but couldn't create one for a line chart. Also, the tool-tips doesn't seem to work if the bars in the bar chart is overlapping (bar-in-bar chart). I can share my code if required.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Champion
Community Champion

If you need to show a tooltip for dots you should render the dots first.

Please used d3.data method to bind data to each dot. Each data point must contain tooltip data that you want to show.

After that you need call addTooltip as you do in the code but the first argument must represent d3.selection for dots.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

4 REPLIES 4
Community Champion
Community Champion

We don't have any sample custom visual that implements tooltip for line chart.

It seams you should detect cursor position and get data that is related to mouse position. After that, you should send data to Tooltip API.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Thanks for your reply @v-viig. I understand that the tool-tips in the native line chart are quite advanced. I will be happy with simple tool-tips which shows on hovering the dots which connects the lines in the line chart. Can you help me with that? I have shared my code with you

Community Champion
Community Champion

If you need to show a tooltip for dots you should render the dots first.

Please used d3.data method to bind data to each dot. Each data point must contain tooltip data that you want to show.

After that you need call addTooltip as you do in the code but the first argument must represent d3.selection for dots.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

Any chance somebody can share some up to date code examples of a basic tooltip (i.e. looks like native Power BI) for a custom visual dot chart?

Helpful resources

Announcements
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Kudoed Authors