Ext.define('school.view.analysis.attence.Chart1', { extend: 'school.view.core.chart.ChartBase', xtype: 'attence-chart1', title: '初三年级本周准勤率', initComponent: function () { var me = this; Ext.apply(me, { items: [{ xtype: 'echartsbase', bind: { store: '{chart1}', }, createOption: me.createOption.bind(me) }] }); me.callParent(arguments); }, createOption: function (store) { var me = this, fields = [], cFields = ['一班', '二班', '三班', '四班'], c1 = [], c2 = [], c3 = [], c4 = [], cDatas = [], o; store.each(function (d) { var d = d.data; fields.push(d.day); c1.push(d.c1); c2.push(d.c2); c3.push(d.c3); c4.push(d.c4); }); cDatas.push(c1, c2, c3, c4); return { grid: { left: 0, right: 0, top: 40, bottom: 5, borderColor: '#E5EAEF', containLabel: true }, xAxis: { type: 'category', axisLine: { lineStyle: { color: '#E5EAEF', } }, axisLabel: { color: '#485465', interval: 0 }, data: fields, }, yAxis: { type: 'value', min: 85, axisLine: { lineStyle: { color: '#E5EAEF', } }, splitLine: { lineStyle: { color: ['#E5EAEF'] } }, axisLabel: { color: '#485465' } }, legend: { data: cFields }, series: me.getSeries(cFields, cDatas) }; }, getSeries: function(fields, datas) { let series = []; for(let i = fields.length - 1; i >= 0 ; i--) { let s = { name: fields[i], type: 'line', label: { normal: { show: true } }, data: datas[i] }; series.push(s); } return series; } });