cancel
Showing results for 
Search instead for 
Did you mean: 
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
RicoZhou
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
RicoZhou
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

Thx @RicoZhou 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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors