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: '#E5EAEF', strokeStyle: 'transparent' }, renderer: me.categoryRender },{ type: 'numeric', fields: ['y'], position: 'left', grid: { even: { stroke: '#E5EAEF' }, odd: { stroke: '#E5EAEF', } }, 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 + '月'; } });