Ext.define('saas.view.home.charts.MonthPurchase', { extend: 'saas.view.core.chart.ChartBase', xtype: 'month-purchase', id: 'month-purchase', bind: { title: '本月采购额(万元):{month_purchase_amount}' }, initComponent: function() { var me = this; Ext.apply(me, { items: [{ xtype: 'cartesian', colors: [ '#34BAF6' ], bind: { insetPadding: '{insetPadding}', store: '{month_purchase}', }, axes: [{ type: 'category', fields: ['x'], position: 'bottom', label: { fillStyle: '#485465' }, style: { fill: '#F7F8FA', strokeStyle: 'transparent' }, },{ type: 'numeric', fields: ['y'], position: 'left', adjustByMajorUnit: true, grid: { even: { stroke: '#F7F8FA' }, odd: { stroke: '#F7F8FA', } }, label: { fillStyle: '#485465', textAlign: 'end' }, style: { fill: '#fff', strokeStyle: 'transparent' }, minimum: 0 }], series: [{ type: 'bar', xField: 'x', yField: ['y'], bind: { style: { lineWidth: 0, strokeStyle: 'transparent', maxBarWidth: '{maxBarWidth}', }, }, tooltip: { trackMouse: true, renderer: me.onBarTipRender } }] }] }); me.callParent(arguments); }, onBarTipRender: function (tooltip, record, item) { tooltip.setHtml(record.get('x') + ': ' + record.get('y') + '万元'); }, });