Orders.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Adminhtml dashboard orders diagram
  8. *
  9. * @author Magento Core Team <core@magentocommerce.com>
  10. */
  11. namespace Magento\Backend\Block\Dashboard\Tab;
  12. class Orders extends \Magento\Backend\Block\Dashboard\Graph
  13. {
  14. /**
  15. * @param \Magento\Backend\Block\Template\Context $context
  16. * @param \Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory
  17. * @param \Magento\Backend\Helper\Dashboard\Data $dashboardData
  18. * @param \Magento\Backend\Helper\Dashboard\Order $dataHelper
  19. * @param array $data
  20. */
  21. public function __construct(
  22. \Magento\Backend\Block\Template\Context $context,
  23. \Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory,
  24. \Magento\Backend\Helper\Dashboard\Data $dashboardData,
  25. \Magento\Backend\Helper\Dashboard\Order $dataHelper,
  26. array $data = []
  27. ) {
  28. $this->_dataHelper = $dataHelper;
  29. parent::__construct($context, $collectionFactory, $dashboardData, $data);
  30. }
  31. /**
  32. * Initialize object
  33. *
  34. * @return void
  35. */
  36. protected function _construct()
  37. {
  38. $this->setHtmlId('orders');
  39. parent::_construct();
  40. }
  41. /**
  42. * Prepare chart data
  43. *
  44. * @return void
  45. */
  46. protected function _prepareData()
  47. {
  48. $this->getDataHelper()->setParam('store', $this->getRequest()->getParam('store'));
  49. $this->getDataHelper()->setParam('website', $this->getRequest()->getParam('website'));
  50. $this->getDataHelper()->setParam('group', $this->getRequest()->getParam('group'));
  51. $this->setDataRows('quantity');
  52. $this->_axisMaps = ['x' => 'range', 'y' => 'quantity'];
  53. parent::_prepareData();
  54. }
  55. }