| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- 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;
- }
- });
|