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
0
Hi Lev,
In the tooltip / labels templates you could reach the original data via the dataItem. I.e. the correct configuration is:
Regards,
Iliana Nikolova
Telerik
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
0
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
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
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
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.