MonthPurchase.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. Ext.define('saas.view.home.charts.MonthPurchase', {
  2. extend: 'saas.view.core.chart.ChartBase',
  3. xtype: 'month-purchase',
  4. requires: [
  5. 'Ext.chart.CartesianChart',
  6. 'Ext.chart.axis.Category',
  7. 'Ext.chart.axis.Numeric',
  8. 'Ext.chart.interactions.PanZoom',
  9. 'Ext.chart.series.Bar'
  10. ],
  11. id: 'month-purchase',
  12. iconCls: 'x-fa fa-bar-chart',
  13. bind: {
  14. title: '本月采购额(万元):{month_purchase_amount}',
  15. },
  16. items: [{
  17. xtype: 'cartesian',
  18. colors: [
  19. '#34BAF6'
  20. ],
  21. bind: '{month_purchase}',
  22. axes: [{
  23. type: 'category',
  24. fields: [
  25. 'x'
  26. ],
  27. hidden: true,
  28. position: 'bottom'
  29. },{
  30. type: 'numeric',
  31. fields: [
  32. 'y'
  33. ],
  34. grid: {
  35. odd: {
  36. fill: '#e8e8e8'
  37. }
  38. },
  39. hidden: true,
  40. position: 'left'
  41. }],
  42. series: [{
  43. type: 'bar',
  44. xField: 'x',
  45. yField: [
  46. 'y'
  47. ]
  48. }],
  49. platformConfig: {
  50. phone: {
  51. // On a phone the whole view becomes a vertical strip of charts,
  52. // which makes it impossible to scroll the view if touch action
  53. // started on a chart. So we use a custom touchAction config.
  54. touchAction: {
  55. panX: true,
  56. panY: true
  57. }
  58. },
  59. '!phone': {
  60. interactions: {
  61. type: 'panzoom',
  62. zoomOnPanGesture: true
  63. }
  64. }
  65. }
  66. }]
  67. });