I have a service returning JSON like:
{
"data": [
{
"portfolio": "Portfolio 01",
"REGN_NME": "Africa/Middle E",
"Regn_Group": "Emerging",
"sector": "Sector 08",
"exposure": 0.109977544284
},
{
"portfolio": "Portfolio 01",
"REGN_NME": "Americas",
"Regn_Group": "Frontier",
"sector": "Sector 06",
"exposure": 1.78919403995e-09
},
...
]}
I'm trying to generate a grouped and stacked column chart. I need to group by the "portfolio", stack by "Regn_Group", and aggregate "exposure".
I can get the chart to either stack, or group, but not both.
Here is what I have so far
<script id="toolTipTemplate" type="text/x-kendo-tmpl">
#= series.name # - #= kendo.toString(value || 0,'p2') #
</script>
<script type="text/javascript">
$(function() {
$("#chart1").kendoChart({
title: {text: "Portfolio Sector Exposure"},
dataSource: {
transport: {
read: {
url:"exposure2.json"
}
},
schema: {
data: "data"
},
group: [{
field: "portfolio"
}],
stack: "Regn_Group"
},
legend:{
position:"bottom"
},
series: [{
type: "column",
field: "exposure",
categoryField: "sector",
aggregate: "sum"
}],
tooltip: {
visible: true,
template: $("#toolTipTemplate").html(),
}
});
});
</script>