| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- Ext.define('school.view.analysis.consumption.Chart2', {
- extend: 'school.view.core.chart.ChartBase',
- xtype: 'consumption-chart2',
- title: '学生校园消费占比分析',
- initComponent: function () {
- var me = this;
- Ext.apply(me, {
- items: [{
- xtype: 'echartsbase',
- bind: {
- store: '{chart2}',
- },
- createOption: me.createOption.bind(me)
- }]
- });
- me.callParent(arguments);
- },
- createOption: function (store) {
- var me = this,
- fields = [],
- data = [];
- store.each(function (d) {
- var d = d.data;
- fields.push(d.type);
- data.push({
- name: d.type,
- value: d.money
- });
- });
- o = {
- grid: {
- left: 0,
- right: 0,
- top: 60,
- bottom: 5,
- borderColor: '#E5EAEF',
- containLabel: true
- },
- tooltip : {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {d}%"
- },
- legend: {
- data: fields
- },
- series : [{
- name: '消费类别',
- type: 'pie',
- radius : '55%',
- // center: ['40%', '50%'],
- data: data,
- itemStyle: {
- emphasis: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- }
- }]
- };
- return o;
- }
- });
|