| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- 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: {
- fontSize: '12px',
- fillStyle: '#485465',
- },
- style: {
- fill: '#F7F8FA',
- strokeStyle: 'transparent'
- },
- renderer: me.onCategoryLabelRender
- },{
- type: 'numeric',
- fields: ['y'],
- position: 'left',
- adjustByMajorUnit: true,
- grid: {
- even: {
- stroke: '#F7F8FA'
- },
- odd: {
- stroke: '#F7F8FA',
- }
- },
- label: {
- fontSize: '12px',
- 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);
- },
- onCategoryLabelRender: function(axis, label, layoutContent, lastLabel) {
- return label.substr(0,2) + '...';
- },
- onBarTipRender: function (tooltip, record, item) {
- tooltip.setHtml(record.get('x') + ': ' + record.get('y') + '万元');
- },
- });
|