4

Magento admin dashboard chart shows last 24 hours stats by default.

How to show last 7 days by default instead?

Is this possible without overriding core files?

1

1 Answer 1

3

You need to rewrite the method Mage_Adminhtml_Block_Dashboard_Graph::_prepareData.
by default it looks like this:

protected function _prepareData()
{
    $availablePeriods = array_keys($this->helper('adminhtml/dashboard_data')->getDatePeriods());
    $period = $this->getRequest()->getParam('period');
    $this->getDataHelper()->setParam('period',
        ($period && in_array($period, $availablePeriods)) ? $period : '24h'
    );
}

You need to replace 24h with 7d.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.