When trying to bind to nested fields, the chart control does not work. What is the trick to getting it working?
var chartData = _DataManager.executeLocal(new ej.data.Query()
.where('group.dnis.length', 'equal', 12)
.select(['group.DNIS_Campaign', 'group.dnis as dnis', 'flattenedMetrics.nOffered_count as nOffered_count', 'flattenedMetrics.tIvr_count', 'flattenedMetrics.tAnswered_count'])
.sortBy('group.DNIS_Campaign')
);
new ej.charts.Chart({
primaryXAxis: {
valueType: 'Category',
title: 'Campaign',
labelRotation: 45
},
primaryYAxis: {
title: 'Call Count'
},
series: [{
dataSource: chartData,
xName: 'group.DNIS_Campaign', yName: 'flattenedMetrics.tIvr_count',
name: 'IVR', type: 'Column'
}, {
dataSource: chartData,
xName: 'group.DNIS_Campaign', yName: 'flattenedMetrics.nOffered_count',
name: 'Offered', type: 'Column'
}, {
dataSource: chartData,
xName: 'group.DNIS_Campaign', yName: 'flattenedMetrics.tAnswered_count',
name: 'Answered', type: 'Column'
}],
title: 'Calls by Campaign',
//Zooming for chart
zoomSettings:
{
enableSelectionZooming: true,
enableScrollbar: true,
enableMouseWheelZooming: true,
enablePinchZooming: true,
//toolbar items for zooming toolkit
toolbarItems: ['Zoom', 'Pan', 'Reset']
},
}, '#Chart');