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

Setting RadHtmlChart tooltip in the code

1 Answer 287 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 01 Sep 2020, 12:52 PM

Hello,

 

I would like my tooltip not to show the x an y coordinates on my ScatterSeries, but another string (ProjectName). ProjectName is a column in my datatable that I'm using as the source.

 

Can you please tell me what's wrong  with the following code? It shows undefined when I hover over a plot item.

 scatterSeries.TooltipsAppearance.ClientTemplate = "#=dataItem.projectname#";

 

Thank you

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 04 Sep 2020, 12:30 PM

Hi Sean,

The syntaxis used in the CleintTemplates of the chart is executed as JavaScript and is case sensitive. In case the data field that you want to access is named "ProjectName" (with this spacing), the spelling of the same in the client template must be:

 scatterSeries.TooltipsAppearance.ClientTemplate = "#=dataItem.ProjectName#";

Regards,
Vessy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Chart (HTML5)
Asked by
Sean
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or