| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- Ext.define('saas.view.home.charts.PurchaseTrend', {
- extend: 'saas.view.core.chart.ChartBase',
- xtype: 'purchase-trend',
- id: 'purchase_trend',
- bind: {
- title: '近六月采购趋势图(万元)'
- },
- initComponent: function() {
- var me = this;
- Ext.apply(me, {
- items: [{
- xtype: 'cartesian',
- colors: [
- '#34BAF6'
- ],
- bind: {
- insetPadding: '{insetPadding}',
- store: '{purchase_trend}',
- },
- axes: [{
- // title: {
- // text: '月',
- // fontSize: 14,
- // },
- type: 'category',
- fields: ['x'],
- position: 'bottom',
- label: {
- fontSize: '12px',
- fillStyle: '#485465'
- },
- style: {
- fill: '#E2E7ED',
- strokeStyle: 'transparent'
- },
- renderer: me.categoryRender
- },{
- type: 'numeric',
- fields: ['y'],
- position: 'left',
- grid: {
- even: {
- stroke: '#E2E7ED'
- },
- odd: {
- stroke: '#E2E7ED',
- }
- },
- label: {
- fontSize: '12px',
- fillStyle: '#485465'
- },
- style: {
- fill: '#fff',
- strokeStyle: 'transparent'
- },
- }],
- series: [{
- type: 'bar',
- xField: 'x',
- yField: ['y'],
- tooltip: {
- trackMouse: true,
- renderer: me.onBarTipRender
- },
- // label: {
- // field: 'y',
- // display: 'insideEnd',
- // fontSize: '12px',
- // strokeStyle: '#fff',
- // },
- bind: {
- style: {
- lineWidth: 0,
- strokeStyle: 'transparent',
- maxBarWidth: '{maxBarWidth}',
- },
- },
- }]
- }]
- });
- me.callParent(arguments);
- },
- onBarTipRender: function (tooltip, record, item) {
- tooltip.setHtml(record.get('x') + '月: ' + Ext.util.Format.number(record.get('y'), '0,000.00') + '万元');
- },
- categoryRender: function(axis, label, layoutContext, lastLabel) {
- return label + '月';
- }
- });
|