| HTML <ejs-chart #chart id='chartcontainer' > <e-series-collection> <e-series [dataSource]='data' type='Column' xName='x' yName='y' > </e-series> </e-series-collection> </ejs-chart> <button ejs-button class='e-flat' (click)='add()'>add </button> TS export class AppComponent implements OnInit { @ViewChild('chart') public chart: ChartComponent; add() { this.chart.addSeries([{ type: 'Column', dataSource: [{ x: 'John', y: 11000 }, { x: 'Jake', y: 16000 }, { x: 'Peter', y: 19000 }, { x: 'James', y: 12000 }, { x: 'Mary', y: 10700 }], xName: 'x', width: 2, yName: 'y' }]); } } |
| HTML: <e-series-collection> <e-series [dataSource]='data' type='Line' xName='x' yName='y' name="Umer"> </eseries> </e-series-collection> TS: add() { this.chart.addSeries([{ type: 'Column', dataSource: [{ x: new Date(2018, 3, 8 , 14 , 26 , 1), y: 52.61 }, { x: new Date(2018, 3, 8,14,26,4), y: 60.57 }, { x: new Date(2018, 3, 8,14,26,9), y: 90.29 }, { x: new Date(2018, 3, 8,14,26,23), y: 125.04 }], xName: 'x', width: 2, yName: 'y', name: ‘series’ }]); } |