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