StockAmount.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. type: 'category',
  29. fields: ['x'],
  30. position: 'bottom',
  31. style: {
  32. fill: '#E7EBEF',
  33. strokeStyle: 'transparent'
  34. },
  35. },{
  36. type: 'numeric',
  37. fields: ['y'],
  38. position: 'left',
  39. grid: {
  40. even: {
  41. stroke: '#E7EBEF',
  42. },
  43. odd: {
  44. stroke: '#E7EBEF',
  45. }
  46. },
  47. style: {
  48. fill: '#fff',
  49. strokeStyle: 'transparent'
  50. },
  51. }],
  52. series: [{
  53. type: 'bar',
  54. xField: 'x',
  55. yField: ['y'],
  56. tooltip: {
  57. trackMouse: true,
  58. renderer: me.onBarTipRender
  59. },
  60. style: {
  61. lineWidth: 0,
  62. strokeStyle: 'transparent',
  63. maxBarWidth: 50,
  64. },
  65. }]
  66. }]
  67. });
  68. me.callParent(arguments);
  69. },
  70. onBarTipRender: function (tooltip, record, item) {
  71. tooltip.setHtml(record.get('x') + ': ' + record.get('y') + '万元');
  72. },
  73. });