function selection(args) {
var chart = document.getElementById("sessionGraph").ej2_instances[0];
if (args.data.text == 'Session') {
chart.primaryXAxis.valueType = 'Category';
chart.primaryXAxis.labelFormat = '';
chart.series[0].dataSource = [
{ x: 10, y: 22 }, { x: 20, y: 16 },
{ x: 30, y: 32 }, { x: 40, y: 18 },
];
chart.series[0].xName = 'x';
chart.series[0].yName = 'y';
chart.refresh();
} else {
chart.primaryXAxis.valueType = 'DateTime';
chart.primaryXAxis.labelFormat = 'MM-dd-yy';
chart.series[0].dataSource = [
{ x: new Date(2005, 0, 1), y: 21 }, { x: new Date(2006, 0, 1), y: 24 },
{ x: new Date(2007, 0, 1), y: 36 }, { x: new Date(2008, 0, 1), y: 38 },
{ x: new Date(2009, 0, 1), y: 54 }, { x: new Date(2010, 0, 1), y: 57 },
{ x: new Date(2011, 0, 1), y: 70 }
]
chart.series[0].xName = 'x';
chart.series[0].yName = 'y';
chart.refresh();
}
} |
Initial Rendering |
Session |
Date |
|
|
|