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?
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
.