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