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
powerdav
Regular Visitor

Tooltip render changes for custom line chart

Greetings everyone,

 

i'm trying to achieve a goal to render tooltip value as a single value based on hover line, instead of all series of values as default in line chart.

 

After some research in order to get default line chart code, that is not possibile yet because what i found about it is that power bi core repository is not available anymore, i found power kpi 2.0.0 line chart repository as a best way to start with.

Following link: https://github.com/microsoft/PowerBI-visuals-PowerKPI.

 

After get working debugger, i tried to follow powerbi developer documentation (https://docs.microsoft.com/en-us/power-bi/developer/visuals/add-tooltips) and some tips like this post: https://community.powerbi.com/t5/Developer/Custom-line-chart-visual-tooltip/m-p/1387403

But after several attempts in order to understand what's going on and how to change it and my lack of knowledge about this framework, i still fail in what i want to achive.

 

How can i achive this tooltip visualization based on power kpi 2.0.0 code and possibly (but it is an extra) implement tooltip section field as standard line chart?

Or how can i found exaustive documentation/video that can help me and get this stuff a lot more easier?

 

Thank you in advance for help and time you will provide me 😀

 

Regards

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @powerdav 

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.

You can refer to Tooltip utils for tooltip customization in Power BI visuals.

 

Best Regards,

Rico Zhou

 

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

View solution in original post

2 REPLIES 2
v-rzhou-msft
Community Support
Community Support

Hi @powerdav 

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.

You can refer to Tooltip utils for tooltip customization in Power BI visuals.

 

Best Regards,

Rico Zhou

 

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

Thx @v-rzhou-msft for time and help. It definitly help to understand better the code behavior.

 

Is some code snippet that you know  about this case available on github repo that i can check?

 

Regards

 

David

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.