This is a migrated thread and some comments may be shown as answers.

Display chart tooltip on legend item hover event

5 Answers 2049 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alexey
Top achievements
Rank 1
Alexey asked on 04 Jun 2018, 08:18 AM

Hi.

I'm using pie chart. Is there any way to display chart tooltip (kendo-chart-series-item-tooltip) when mouse hovers on legend-item? It must be like on the image.

And it would be great if legend would show categoryField and field value, is it possible?

Thank you.

5 Answers, 1 is accepted

Sort by
0
Alexey
Top achievements
Rank 1
answered on 06 Jun 2018, 06:18 AM

I'm done with the second question, i have to read documentation more attentively.

If someone will look for the answer:

Template:
<kendo-chart-legend position="right" [labels]="{ content: legendLabelData }">
...
Component:
public legendLabelData(data: any) {
   return data.text + ' ' + (data.percentage * 100).toFixed(2) + '%';
}

 

But the second problem is still opened.

0
Accepted
Svet
Telerik team
answered on 06 Jun 2018, 07:28 AM
Hi Alexey,

Thank you for the screenshot.

We can customize the legend items content using the [content] input property of the [labels] input property of the LegendComponent.

About the tooltips, we can display them using the chart's showTooltip function on (legendItemHover) event of the chart. We can also customize the content of the tooltips by using the kendoChartSeriesTooltipTemplate as demonstrated in the following article:

https://www.telerik.com/kendo-angular-ui/components/charts/chart/elements/tooltips/#toc-specifying-a-template

Here is a sample plunker demonstrating the discussed approaches:

https://plnkr.co/edit/V2ME5oh6BPR7NHtgN4ra?p=preview

I hope this helps.

Regards,
Svetlin
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Alexey
Top achievements
Rank 1
answered on 06 Jun 2018, 07:54 AM

Hi Svetlin.

Thank you so much, i'm absolutely inattentive, sorry for the wasted time.

0
Selim
Top achievements
Rank 1
answered on 19 Jul 2020, 08:47 PM
Hello i'm searching for an issue to that for kendoreact and your way to develop it does not work for me. Have you an idea of what I maybe did wrong ?
<Chart onLegendItemHover={(e :any) => {
return e.sender.showTooltip((point :any) => point.index === e.pointIndex);
}}>


Thanks you.
0
Svet
Telerik team
answered on 21 Jul 2020, 01:33 PM

Hi Selim,

Currently, the Kendo UI for React suite misses such method as the showTooltip() function suggested in this ticket.

What I can suggest at this point is to log a new feature request in the Kendo React Feedback portal asking for the requirement or open a new thread in the Kendo UI for React forum:

https://www.telerik.com/forums/kendo-ui-react

Regards,


Svetlin
Progress Telerik

Tags
General Discussions
Asked by
Alexey
Top achievements
Rank 1
Answers by
Alexey
Top achievements
Rank 1
Svet
Telerik team
Selim
Top achievements
Rank 1
Share this question
or