StockAmount.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. Ext.define('saas.view.home.charts.StockAmount', {
  2. extend: 'saas.view.core.chart.ChartBase',
  3. xtype: 'stock-amount',
  4. id: 'stock_amount',
  5. initComponent: function() {
  6. var me = this;
  7. Ext.apply(me, {
  8. items: [{
  9. xtype: 'cartesian',
  10. colors: [
  11. '#34BAF6'
  12. ],
  13. captions: {
  14. title: {
  15. text: '库存金额(万元)',
  16. style: {
  17. 'font-size': '14px',
  18. 'color': '#485465',
  19. 'letter-spacing': '-0.07px'
  20. },
  21. align: 'left'
  22. }
  23. },
  24. bind: {
  25. store: '{stock_amount}',
  26. },
  27. axes: [{
  28. title: {
  29. text: '月',
  30. fontSize: 14,
  31. },
  32. type: 'category',
  33. fields: ['x'],
  34. position: 'bottom',
  35. style: {
  36. fill: '#E7EBEF',
  37. strokeStyle: 'transparent'
  38. },
  39. },{
  40. type: 'numeric',
  41. fields: ['y'],
  42. position: 'left',
  43. grid: {
  44. even: {
  45. stroke: '#E7EBEF',
  46. },
  47. odd: {
  48. stroke: '#E7EBEF',
  49. }
  50. },
  51. style: {
  52. fill: '#fff',
  53. strokeStyle: 'transparent'
  54. },
  55. }],
  56. series: [{
  57. type: 'bar',
  58. xField: 'x',
  59. yField: ['y'],
  60. tooltip: {
  61. trackMouse: true,
  62. renderer: me.onBarTipRender
  63. },
  64. style: {
  65. lineWidth: 0,
  66. strokeStyle: 'transparent',
  67. maxBarWidth: 50,
  68. },
  69. }]
  70. }]
  71. });
  72. me.callParent(arguments);
  73. },
  74. onBarTipRender: function (tooltip, record, item) {
  75. tooltip.setHtml(record.get('x') + ': ' + record.get('y') + '万元');
  76. },
  77. });