$data) { $month[] = '"'.$key.'"'; $openMonth[] = '"'.$data['open'].'"'; $clickMonth[] = '"'.$data['click'].'"'; } $day = []; $openDay = []; $clickDay = []; foreach ($dataDay as $key => $data) { $day[] = '"'.$key.'"'; $openDay[] = '"'.$data['open'].'"'; $clickDay[] = '"'.$data['click'].'"'; } $hour = []; $openHour = []; $clickHour = []; foreach ($dataHour as $key => $data) { $hour[] = '"'.$key.'"'; $openHour[] = '"'.$data['open'].'"'; $clickHour[] = '"'.$data['click'].'"'; } $randNumber = rand(1000, 9000); $idCanvas = 'acy_canvas_rand_id'.$randNumber; $idLegend = 'acy_legend_rand_id'.$randNumber; $return = ''; $nbDataDay = count($dataDay); $nbDataHour = count($dataHour); $selectedChartHour = ""; $selectedChartDay = ""; $selectedChartMonth = ""; if ($nbDataHour < 49) { $selectedChartHour = "selected__choose_by"; $displayed = $hour; $clickDisplayed = $clickHour; $openDisplayed = $openHour; } elseif ($nbDataDay < 63) { $selectedChartDay = "selected__choose_by"; $displayed = $day; $clickDisplayed = $clickDay; $openDisplayed = $openDay; } else { $selectedChartMonth = "selected__choose_by"; $displayed = $month; $clickDisplayed = $clickMonth; $openDisplayed = $openMonth; } $return .= '
'.acym_translation('ACYM_BY_MONTH').'
'.acym_translation('ACYM_BY_DAY').'
'.acym_translation('ACYM_BY_HOUR').'
'.$topLabel.'
'.$topLabel.'
'.$topLabel.'