public function getDailyChartData()
{
if (!$this->daily_data) {
$this->daily_data = $this->getData($this->daily_file);
}
$limit = intval($this->config->get('plugins.admin.popularity.dashboard.days_of_stats', 7));
$chart_data = array_slice($this->daily_data, -$limit, $limit);
$labels = [];
$data = [];
foreach ($chart_data as $date => $count) {
$labels[] = Grav::instance()['grav']['admin']->translate(['PLUGIN_ADMIN.' . strtoupper(date('D', strtotime($date)))]);
$data[] = $count;
}
return ['labels' => $labels, 'data' => $data];
}