I have an array with the percentage of each chart item, similar to the date. I am trying to build the template, according to the code template: "#= series.abbr #: #= value # (#= series.percent #)
. Here is the code:
$("#chart").kendoChart({
title: {
text: "Gross domestic product growth /GDP annual %/"
},
legend: {
position: "bottom"
},
seriesDefaults: {
labels: {
template: "#= series.abbr #: #= value # (#= series.percent #)",
position: "outsideEnd",
visible: true,
background: "transparent"
},
type: "column"
},
series: [{
abbr: "IND",
name: "India",
data: [3.907, 7.943, 7.848],
percent: [3.2, 7.3, 7.1]
}, {
abbr: "RF",
name: "Russian Federation",
data: [4.743, 7.295, 7.175],
percent: [3.6, 7.4, 7.9]
},{
abbr: "WRD",
name: "World",
data: [1.988, 2.733, 3.994],
percent: [1.3, 2.7, 3.7]
}],
valueAxis: {
labels: {
format: "{0}%"
},
line: {
visible: true
},
axisCrossingValue: 0
},
categoryAxis: {
categories: [2009, 2010, 2011],
line: {
visible: true
},
labels: {
padding: {top: 1}
}
},
tooltip: {
visible: true,
format: "{0}%",
template: "#= series.name #: #= value # : #= series.total #"
}
});
Unfortunately, I can only get series.percent
, so I get the whole line. When generating the graph, it looks like this:
Iwouldliketosomehowaddortakethepercentageofeachgraphitemwithinthepercentarrayandapplyittothegraph,suchasdata
(usingvalue
withintemplate
).Sothegraphwouldlooklikethis: