Set kendo-chart-tooltip position

1 Answer 1477 Views
Charts Tooltip
Smail
Top achievements
Rank 1
Smail asked on 22 Oct 2021, 09:19 AM

How to set the position of the chart tooltip. the problem is that the tooltip is shown by default next the cursor (on the right), so when we move to the right the mouse will be on the tooltip thus the value will not be changed

Thanks

<kendo-chart>

...

<kendo-chart-tooltip >
<ng-template kendoChartSharedTooltipTemplate>

..
</ng-template>
</kendo-chart-tooltip>

</kendo-chart>

 

1 Answer, 1 is accepted

Sort by
3
Stoyan
Telerik team
answered on 27 Oct 2021, 07:40 AM

Hi Smail,

Thanks for the provided information.

The position of the Kendo Chart Tooltip can be set by tweaking the CSS classes of the tooltip.

  1. If you wish to apply positional changes to the tooltip, then the wrapper of the tooltip can be targeted - .k-chart-tooltip-wrapper
  2. If you wish to apply cosmetic changes to the content of the tooltip the  .k-chart-tooltip CSS class can be targeted.

I've prepared a short StackBlitz demo demonstrating the above suggestions:

https://stackblitz.com/edit/angular-airu5e?file=app/app.component.ts

I hope this sheds some light on the matter.

Regards,
Stoyan
Progress Telerik

Remote troubleshooting is now easier with Telerik Fiddler Jam. Get the full context to end-users' issues in just three steps! Start your trial here - https://www.telerik.com/fiddler-jam.
Christian
Top achievements
Rank 1
Iron
commented on 21 Feb 2023, 04:20 PM | edited

The .k-chart-tooltip renders around the kendoChartSeriesTooltipTemplate and setting the tooltip style background-color automatically based on the series.color. This makes us unable to define custom logic how to render the background color. As shown in the image:

What I'm looking for is when I hover over the dot to show the tooltip but I have my own background color which manage to have in data.

Is there a way to disable the setting of color for k-chart-tooltip? So we can achieve following result:

 

Stoyan
Telerik team
commented on 22 Feb 2023, 09:02 AM

Hello Christian,

Thanks for the provided information.

The kendo-chart-tooltip provides the developer with inputs for css styling. For example, if one wants to change the background with a custom color, It can be done through the background input.

I've created a StackBlitz demo which demonstrates the said above:

https://stackblitz.com/edit/angular-ynirkc?file=src%2Fapp%2Fapp.component.ts

I hope this information helps.

Regards,
Stoyan
Progress Telerik

Tags
Charts Tooltip
Asked by
Smail
Top achievements
Rank 1
Answers by
Stoyan
Telerik team
Share this question
or