Hello,
I have below stacked type chart where it display data from a service. I want to display the label value dynamically for each field in the series. Here i have Value and UnusedValue, how to display these values for their respective fileds "Used Capacity" and "Unused Capacity". The below code displays the same value for both fields because the label template doesn't have any condition.
function
createchart(chartID, chartTitle) {
$(chartID).kendoChart({
dataSource: {
transport: {
read: {
url: serviceurl,
dataType:
"json"
}
}
},
title: {
text:
"RAU"
},
legend: {
position:
"right"
},
seriesDefaults: {
type:
"column"
,
stack: {
type:
"100%"
},
labels: {
visible:
true
,
position:
"bottom"
,
template:
"#= dataItem.Value #%"
}
},
series: [{
name:
"Used Capacity"
,
field:
"Value"
,
CategoryField:
"RAU"
}, {
name:
"Unused Capacity"
,
field:
"UnusedValue"
,
CategoryField:
"RAU"
,
color:
"#FFFFFF"
}],
valueAxis: {
line: {
visible:
false
},
minorGridLines: {
visible:
true
},
visible:
false
},
categoryAxis: {
categories: [
"Reliability"
,
"Availability"
,
"Utilisation"
],
majorGridLines: {
visible:
false
}
},
tooltip: {
visible:
true
,
template:
"#= series.name #: #= dataItem.Value #"
}
});
}
Best Regards,
Devendra