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

kendo pie & angular - tooltip & labels templates issue

5 Answers 177 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Lev
Top achievements
Rank 1
Lev asked on 14 Jun 2016, 08:09 PM

Hi!

Environment

2016.2.607 version

Latest Chrome (Windows)

 

kendo pie & angular -  tooltip & labels templates issue

I configured pie chart with code below 

tooltip: {
                visible: true,
                template: "#= year # - test"
            },
            labels: {
                template: "#= year # - test",
                position: "outsideEnd",
                visible: true,
                background: "transparent"
            }

part 1 - labels template commented, kendo fails to create tooltips template (Line 48)

http://codepen.io/lev-savranskiy/pen/dXMErZ?editors=1000

part 2- when labels template uncommented , kendo fails completely

http://codepen.io/lev-savranskiy/pen/xOVowL?editors=1000

 

Any ideas?

 

THanks

 

 

 

 

5 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 16 Jun 2016, 08:57 AM
Hi Lev,

In the tooltip / labels templates you could reach the original data via the dataItem. I.e. the correct configuration is:
//....
tooltip: {
      visible: true,
      template: "#= dataItem.year # - test"
},
labels: {
      template: "#= dataItem.year # - test",
      position: "outsideEnd",
      visible: true,
      background: "transparent"
}
 

Regards,
Iliana Nikolova
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Lev
Top achievements
Rank 1
answered on 16 Jun 2016, 02:01 PM
i see this doc. where is dataItem?
0
Iliana Dyankova
Telerik team
answered on 20 Jun 2016, 07:40 AM
Hi Lev,

You should use the dataItem field to reach the original point data. Take a look at the updated example: 

http://dojo.telerik.com/@Iliana/uJeQe

Regards,
Iliana Nikolova
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Lev
Top achievements
Rank 1
answered on 20 Jun 2016, 07:39 PM

i repeat.

i do not see dataitem in official documentatio

http://demos.telerik.com/kendo-ui/pie-charts/index

i do not quite understand why i should browse forums to get answers which should be described in API

 

thanks

0
Iliana Dyankova
Telerik team
answered on 22 Jun 2016, 07:39 AM
Hi Lev,

As pointed in the online documentation, in series.labels.template you could directly reach category and value - in the online demo which you pointed these are respectively continents and values. In the dojo examples which you provided "year" is none of these - therefore you need to use the dataItem to reach it in the template.

Regards,
Iliana Nikolova
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Charts
Asked by
Lev
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Lev
Top achievements
Rank 1
Share this question
or