MonthSale.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. Ext.define('saas.view.home.charts.MonthSale', {
  2. extend: 'saas.view.core.chart.ChartBase',
  3. xtype: 'month-sale',
  4. requires: [
  5. 'Ext.chart.PolarChart',
  6. 'Ext.chart.interactions.Rotate',
  7. 'Ext.chart.series.Pie',
  8. 'Ext.chart.series.sprite.PieSlice'
  9. ],
  10. id: 'month_sale',
  11. iconCls: 'x-fa fa-pie-chart',
  12. bind: {
  13. title: '本月销售额(万元):{month_sale_amount}',
  14. },
  15. initComponent: function() {
  16. var me = this;
  17. Ext.apply(me, {
  18. items: [{
  19. xtype: 'polar',
  20. width: '100%',
  21. height: 500,
  22. innerPadding: me.innerPadding || 20,
  23. interactions: ['rotate', 'itemhighlight'],
  24. donut: 30,
  25. colors: [
  26. '#2C82BE',
  27. '#27A7FF',
  28. '#82CCFF',
  29. '#53A8E2',
  30. '#76DDFB',
  31. '#DBECF8',
  32. ],
  33. bind: {
  34. store: '{month_sale}',
  35. },
  36. style: {
  37. border: 'none'
  38. },
  39. series: [{
  40. type: 'pie',
  41. angleField: me.yfield || 'yvalue',
  42. label: {
  43. field: me.xfield || 'xvalue',
  44. display: 'rotate'
  45. },
  46. donut: 55,
  47. highlight: true,
  48. tooltip: {
  49. trackMouse: true,
  50. renderer: me.onSeriesTooltipRender
  51. }
  52. }],
  53. // legend: {
  54. // docked: 'bottom'
  55. // },
  56. }]
  57. });
  58. me.callParent(arguments);
  59. },
  60. onSeriesTooltipRender: function (tooltip, record, item) {
  61. tooltip.setHtml(record.get('xvalue') + ': ' + record.get('data1') + '%');
  62. }
  63. });