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 Answer 1


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');
        ($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 that you have read and understand our privacy policy and code of conduct.

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