Analytics: graph of QSOs for each day in the log

pull/3232/head
Danny 2024-11-30 16:53:52 +01:00
rodzic ef2ea82435
commit 61b40a010d
19 zmienionych plików z 171 dodań i 14 usunięć

Wyświetl plik

@ -50,4 +50,15 @@ class Dayswithqso extends CI_Controller {
echo json_encode($data);
}
public function get_historydays(){
//load model
$this->load->model('dayswithqso_model');
// get data
$data = $this->dayswithqso_model->getHistoryDays();
header('Content-Type: application/json');
echo json_encode($data);
}
}

Wyświetl plik

@ -56,9 +56,12 @@ $lang['statistics_timeline'] = "Timeline";
$lang['statistics_tab_yearly'] = "Yearly";
$lang['statistics_tab_streaks'] = "Streaks";
$lang['statistics_tab_weekdays'] = "Days of the week";
$lang['statistics_tab_daily'] = "Daily";
$lang['statistics_days_yearly'] = "Number of days with QSOs each year";
$lang['statistics_days_with_qso'] = "Days with QSOs";
$lang['statistics_qsos_each_day'] = "Number of QSOs each day";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_number_of_qsos_this_day'] = "Number of QSOs this day";
$lang['statistics_number_of_qsos_this_weekday'] = "Number of QSOs for this day of the week";
$lang['statistics_dwq_longest_streak_in_log'] = "Longest streak with QSOs in the log";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "A maximum of the 10 longest streaks are shown!";
@ -67,4 +70,3 @@ $lang['statistics_dwq_current_streak_in_log'] = "Current streak with QSOs in the
$lang['statistics_dwq_current_streak_continuous_days'] = "Current streak (continuous days with QSOs)";
$lang['statistics_dwq_make_qso_to_extend_streak'] = "If you make a QSO today, you can continue to extend your streak... or else your current streak will be broken!";
$lang['statistics_dwq_no_current_streak'] = "No current streak found!";

Wyświetl plik

@ -56,9 +56,12 @@ $lang['statistics_timeline'] = "时间线";
$lang['statistics_tab_yearly'] = "Yearly";
$lang['statistics_tab_streaks'] = "Streaks";
$lang['statistics_tab_weekdays'] = "Days of the week";
$lang['statistics_tab_daily'] = "Daily";
$lang['statistics_days_yearly'] = "Number of days with QSOs each year";
$lang['statistics_days_with_qso'] = "QSO的日期";
$lang['statistics_qsos_each_day'] = "Number of QSOs each day";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_number_of_qsos_this_day'] = "Number of QSOs this day";
$lang['statistics_number_of_qsos_this_weekday'] = "Number of QSOs for this day of the week";
$lang['statistics_dwq_longest_streak_in_log'] = "日志中最长QSO连续记录";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "最多显示10条最长QSO连续记录";
@ -67,4 +70,3 @@ $lang['statistics_dwq_current_streak_in_log'] = "目前的QSO连续记录";
$lang['statistics_dwq_current_streak_continuous_days'] = "当前连续天数";
$lang['statistics_dwq_make_qso_to_extend_streak'] = "如果你今天进行了QSO那么就能延长你的连续天数否则将会被打破清零";
$lang['statistics_dwq_no_current_streak'] = "没有找到连续的天数";

Wyświetl plik

@ -56,9 +56,12 @@ $lang['statistics_timeline'] = "Timeline";
$lang['statistics_tab_yearly'] = "Yearly";
$lang['statistics_tab_streaks'] = "Streaks";
$lang['statistics_tab_weekdays'] = "Days of the week";
$lang['statistics_tab_daily'] = "Daily";
$lang['statistics_days_yearly'] = "Number of days with QSOs each year";
$lang['statistics_days_with_qso'] = "Days with QSOs";
$lang['statistics_qsos_each_day'] = "Number of QSOs each day";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_number_of_qsos_this_day'] = "Number of QSOs this day";
$lang['statistics_number_of_qsos_this_weekday'] = "Number of QSOs for this day of the week";
$lang['statistics_dwq_longest_streak_in_log'] = "Longest streak with QSOs in the log";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "A maximum of the 10 longest streaks are shown!";
@ -67,4 +70,3 @@ $lang['statistics_dwq_current_streak_in_log'] = "Current streak with QSOs in the
$lang['statistics_dwq_current_streak_continuous_days'] = "Current streak (continuous days with QSOs)";
$lang['statistics_dwq_make_qso_to_extend_streak'] = "If you make a QSO today, you can continue to extend your streak... or else your current streak will be broken!";
$lang['statistics_dwq_no_current_streak'] = "No current streak found!";

Wyświetl plik

@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked";
*/
$lang['statistics_distances_bands_all'] = "All";
$lang['statistics_distances_modes_all'] = "All";
$lang['statistics_distances_worked'] = "Distances Worked";
$lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.<br /> Your furthest contact was with";
$lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare";
@ -33,8 +34,10 @@ $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distan
$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is";
$lang['statistics_distances_number_of_qsos'] = "Number of QSOs";
$lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)";
$lang['statistics_distances_qsos_with'] = "QSOs with";
$lang['statistics_distances_and_band'] = "and band";
$lang['statistics_distances_qsos_with'] = "QSOs with distance : ";
$lang['statistics_distances_and_band'] = ", band : ";
$lang['statistics_distances_and_mode'] = ", mode : ";
$lang['statistics_distances_and_power'] = ", power : ";
/*
*
@ -53,9 +56,12 @@ $lang['statistics_timeline'] = "Timeline";
$lang['statistics_tab_yearly'] = "Yearly";
$lang['statistics_tab_streaks'] = "Streaks";
$lang['statistics_tab_weekdays'] = "Days of the week";
$lang['statistics_tab_daily'] = "Daily";
$lang['statistics_days_yearly'] = "Number of days with QSOs each year";
$lang['statistics_days_with_qso'] = "Days with QSOs";
$lang['statistics_qsos_each_day'] = "Number of QSOs each day";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_number_of_qsos_this_day'] = "Number of QSOs this day";
$lang['statistics_number_of_qsos_this_weekday'] = "Number of QSOs for this day of the week";
$lang['statistics_dwq_longest_streak_in_log'] = "Longest streak with QSOs in the log";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "A maximum of the 10 longest streaks are shown!";
@ -64,4 +70,3 @@ $lang['statistics_dwq_current_streak_in_log'] = "Current streak with QSOs in the
$lang['statistics_dwq_current_streak_continuous_days'] = "Current streak (continuous days with QSOs)";
$lang['statistics_dwq_make_qso_to_extend_streak'] = "If you make a QSO today, you can continue to extend your streak... or else your current streak will be broken!";
$lang['statistics_dwq_no_current_streak'] = "No current streak found!";

Wyświetl plik

@ -56,9 +56,12 @@ $lang['statistics_timeline'] = "Timeline";
$lang['statistics_tab_yearly'] = "Yearly";
$lang['statistics_tab_streaks'] = "Streaks";
$lang['statistics_tab_weekdays'] = "Days of the week";
$lang['statistics_tab_daily'] = "Daily";
$lang['statistics_days_yearly'] = "Number of days with QSOs each year";
$lang['statistics_days_with_qso'] = "Days with QSOs";
$lang['statistics_qsos_each_day'] = "Number of QSOs each day";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_number_of_qsos_this_day'] = "Number of QSOs this day";
$lang['statistics_number_of_qsos_this_weekday'] = "Number of QSOs for this day of the week";
$lang['statistics_dwq_longest_streak_in_log'] = "Longest streak with QSOs in the log";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "A maximum of the 10 longest streaks are shown!";

Wyświetl plik

@ -56,9 +56,12 @@ $lang['statistics_timeline'] = "Timeline";
$lang['statistics_tab_yearly'] = "Yearly";
$lang['statistics_tab_streaks'] = "Streaks";
$lang['statistics_tab_weekdays'] = "Days of the week";
$lang['statistics_tab_daily'] = "Daily";
$lang['statistics_days_yearly'] = "Number of days with QSOs each year";
$lang['statistics_days_with_qso'] = "Days with QSOs";
$lang['statistics_qsos_each_day'] = "Number of QSOs each day";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_number_of_qsos_this_day'] = "Number of QSOs this day";
$lang['statistics_number_of_qsos_this_weekday'] = "Number of QSOs for this day of the week";
$lang['statistics_dwq_longest_streak_in_log'] = "Longest streak with QSOs in the log";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "A maximum of the 10 longest streaks are shown!";

Wyświetl plik

@ -53,12 +53,15 @@ $lang['statistics_timeline'] = "Chronologie";
*
*/
$lang['statistics_tab_yearly'] = "Statistiques annuelles";
$lang['statistics_tab_yearly'] = "Années";
$lang['statistics_tab_streaks'] = "Séries de jours";
$lang['statistics_tab_weekdays'] = "Jours de la semaine";
$lang['statistics_tab_daily'] = "Historique par jour";
$lang['statistics_days_yearly'] = "Nombre de jours avec des QSOs par année";
$lang['statistics_days_with_qso'] = "Jours avec des QSOs";
$lang['statistics_qsos_each_day'] = "Nombre de QSOs chaque jour";
$lang['statistics_weekdays_with_qso'] = "QSOs par jour de la semaine";
$lang['statistics_number_of_qsos_this_day'] = "Nombre de QSOs ce jour";
$lang['statistics_number_of_qsos_this_weekday'] = "Nombre de QSOs pour ce jour de la semaine";
$lang['statistics_dwq_longest_streak_in_log'] = "Plus longue série de jours avec des QSOs";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "Seules les 10 plus longues séries sont affichées";

Wyświetl plik

@ -59,6 +59,9 @@ $lang['statistics_tab_weekdays'] = "Days of the week";
$lang['statistics_days_yearly'] = "Number of days with QSOs each year";
$lang['statistics_days_with_qso'] = "Tage mit QSOs";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_qsos_each_day'] = "Number of QSOs each day";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_number_of_qsos_this_day'] = "Number of QSOs this day";
$lang['statistics_number_of_qsos_this_weekday'] = "Number of QSOs for this day of the week";
$lang['statistics_dwq_longest_streak_in_log'] = "Längste Serie mit QSOs im Logbuch";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "Es werden maximal die 10 längsten Serien angezeigt!";
@ -67,4 +70,3 @@ $lang['statistics_dwq_current_streak_in_log'] = "Aktuelle Serie mit QSOs im Logb
$lang['statistics_dwq_current_streak_continuous_days'] = "Aktuelle Serie (fortlaufende Tage mit QSOs)";
$lang['statistics_dwq_make_qso_to_extend_streak'] = "Wenn Sie heute ein QSO machen, können Sie Ihre Serie verlängern... Andernfalls wird Ihre aktuelle Serie unterbrochen!";
$lang['statistics_dwq_no_current_streak'] = "Keine aktuelle Serie gefunden!";

Wyświetl plik

@ -56,9 +56,12 @@ $lang['statistics_timeline'] = "Timeline";
$lang['statistics_tab_yearly'] = "Yearly";
$lang['statistics_tab_streaks'] = "Streaks";
$lang['statistics_tab_weekdays'] = "Days of the week";
$lang['statistics_tab_daily'] = "Daily";
$lang['statistics_days_yearly'] = "Number of days with QSOs each year";
$lang['statistics_days_with_qso'] = "Days with QSOs";
$lang['statistics_qsos_each_day'] = "Number of QSOs each day";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_number_of_qsos_this_day'] = "Number of QSOs this day";
$lang['statistics_number_of_qsos_this_weekday'] = "Number of QSOs for this day of the week";
$lang['statistics_dwq_longest_streak_in_log'] = "Longest streak with QSOs in the log";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "A maximum of the 10 longest streaks are shown!";
@ -67,4 +70,3 @@ $lang['statistics_dwq_current_streak_in_log'] = "Current streak with QSOs in the
$lang['statistics_dwq_current_streak_continuous_days'] = "Current streak (continuous days with QSOs)";
$lang['statistics_dwq_make_qso_to_extend_streak'] = "If you make a QSO today, you can continue to extend your streak... or else your current streak will be broken!";
$lang['statistics_dwq_no_current_streak'] = "No current streak found!";

Wyświetl plik

@ -56,9 +56,12 @@ $lang['statistics_timeline'] = "Sequenza temporale";
$lang['statistics_tab_yearly'] = "Yearly";
$lang['statistics_tab_streaks'] = "Streaks";
$lang['statistics_tab_weekdays'] = "Days of the week";
$lang['statistics_tab_daily'] = "Daily";
$lang['statistics_days_yearly'] = "Number of days with QSOs each year";
$lang['statistics_days_with_qso'] = "Giorni con QSO";
$lang['statistics_qsos_each_day'] = "Number of QSOs each day";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_number_of_qsos_this_day'] = "Number of QSOs this day";
$lang['statistics_number_of_qsos_this_weekday'] = "Number of QSOs for this day of the week";
$lang['statistics_dwq_longest_streak_in_log'] = "Serie più lunga di QSO nel log";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "Vengono mostrate al massimo le 10 serie più lunghe!";
@ -67,4 +70,3 @@ $lang['statistics_dwq_current_streak_in_log'] = "Serie attuale di QSO nel log";
$lang['statistics_dwq_current_streak_continuous_days'] = "Serie attuale (giorni continui con QSO)";
$lang['statistics_dwq_make_qso_to_extend_streak'] = "Se fai un QSO oggi, puoi continuare ad estendere la tua serie di vittorie consecutive... altrimenti la tua serie di vittorie attuali verrà interrotta!";
$lang['statistics_dwq_no_current_streak'] = "Nessuna serie attuale trovata!";

Wyświetl plik

@ -56,9 +56,12 @@ $lang['statistics_timeline'] = "Timeline";
$lang['statistics_tab_yearly'] = "Yearly";
$lang['statistics_tab_streaks'] = "Streaks";
$lang['statistics_tab_weekdays'] = "Days of the week";
$lang['statistics_tab_daily'] = "Daily";
$lang['statistics_days_yearly'] = "Number of days with QSOs each year";
$lang['statistics_days_with_qso'] = "Days with QSOs";
$lang['statistics_qsos_each_day'] = "Number of QSOs each day";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_number_of_qsos_this_day'] = "Number of QSOs this day";
$lang['statistics_number_of_qsos_this_weekday'] = "Number of QSOs for this day of the week";
$lang['statistics_dwq_longest_streak_in_log'] = "Longest streak with QSOs in the log";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "A maximum of the 10 longest streaks are shown!";
@ -67,4 +70,3 @@ $lang['statistics_dwq_current_streak_in_log'] = "Current streak with QSOs in the
$lang['statistics_dwq_current_streak_continuous_days'] = "Current streak (continuous days with QSOs)";
$lang['statistics_dwq_make_qso_to_extend_streak'] = "If you make a QSO today, you can continue to extend your streak... or else your current streak will be broken!";
$lang['statistics_dwq_no_current_streak'] = "No current streak found!";

Wyświetl plik

@ -56,9 +56,12 @@ $lang['statistics_timeline'] = "Лента времени";
$lang['statistics_tab_yearly'] = "Yearly";
$lang['statistics_tab_streaks'] = "Streaks";
$lang['statistics_tab_weekdays'] = "Days of the week";
$lang['statistics_tab_daily'] = "Daily";
$lang['statistics_days_yearly'] = "Number of days with QSOs each year";
$lang['statistics_days_with_qso'] = "Дней с QSO";
$lang['statistics_qsos_each_day'] = "Number of QSOs each day";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_number_of_qsos_this_day'] = "Number of QSOs this day";
$lang['statistics_number_of_qsos_this_weekday'] = "Number of QSOs for this day of the week";
$lang['statistics_dwq_longest_streak_in_log'] = "Самый длинный интервал дней с QSO в журнале";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "Отображаются 10 самых длинных интервалов!";
@ -67,4 +70,3 @@ $lang['statistics_dwq_current_streak_in_log'] = "Текущий интервал
$lang['statistics_dwq_current_streak_continuous_days'] = "Текущий интервал (непрерывных дней с QSO)";
$lang['statistics_dwq_make_qso_to_extend_streak'] = "Если вы проведёте QSO сегодня, вы можете удлинить текущий интерывл дней с QSO... иначе текущий интервал будет прерван!";
$lang['statistics_dwq_no_current_streak'] = "Текущий интервал не найден!";

Wyświetl plik

@ -56,9 +56,12 @@ $lang['statistics_timeline'] = "Línea de tiempo";
$lang['statistics_tab_yearly'] = "Yearly";
$lang['statistics_tab_streaks'] = "Streaks";
$lang['statistics_tab_weekdays'] = "Days of the week";
$lang['statistics_tab_daily'] = "Daily";
$lang['statistics_days_yearly'] = "Number of days with QSOs each year";
$lang['statistics_days_with_qso'] = "Días con QSOs";
$lang['statistics_qsos_each_day'] = "Number of QSOs each day";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_number_of_qsos_this_day'] = "Number of QSOs this day";
$lang['statistics_number_of_qsos_this_weekday'] = "Number of QSOs for this day of the week";
$lang['statistics_dwq_longest_streak_in_log'] = "Mayor racha de QSOs en el libro";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "¡Se muestra un máximo de 10 rachas más largas!";
@ -67,4 +70,3 @@ $lang['statistics_dwq_current_streak_in_log'] = "Racha actual con QSOs en el lib
$lang['statistics_dwq_current_streak_continuous_days'] = "Racha actual (días continuos con QSOs)";
$lang['statistics_dwq_make_qso_to_extend_streak'] = "Si hace un QSO hoy, ¡puede continuar y extender su racha... De lo contrario, su racha actual se perderá!";
$lang['statistics_dwq_no_current_streak'] = "¡No se encuentra una racha actual!";

Wyświetl plik

@ -56,9 +56,12 @@ $lang['statistics_timeline'] = "Timeline";
$lang['statistics_tab_yearly'] = "Yearly";
$lang['statistics_tab_streaks'] = "Streaks";
$lang['statistics_tab_weekdays'] = "Days of the week";
$lang['statistics_tab_daily'] = "Daily";
$lang['statistics_days_yearly'] = "Number of days with QSOs each year";
$lang['statistics_days_with_qso'] = "Days with QSOs";
$lang['statistics_qsos_each_day'] = "Number of QSOs each day";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_number_of_qsos_this_day'] = "Number of QSOs this day";
$lang['statistics_number_of_qsos_this_weekday'] = "Number of QSOs for this day of the week";
$lang['statistics_dwq_longest_streak_in_log'] = "Longest streak with QSOs in the log";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "A maximum of the 10 longest streaks are shown!";
@ -67,4 +70,3 @@ $lang['statistics_dwq_current_streak_in_log'] = "Current streak with QSOs in the
$lang['statistics_dwq_current_streak_continuous_days'] = "Current streak (continuous days with QSOs)";
$lang['statistics_dwq_make_qso_to_extend_streak'] = "If you make a QSO today, you can continue to extend your streak... or else your current streak will be broken!";
$lang['statistics_dwq_no_current_streak'] = "No current streak found!";

Wyświetl plik

@ -56,9 +56,12 @@ $lang['statistics_timeline'] = "Zaman Çizelgesi";
$lang['statistics_tab_yearly'] = "Yearly";
$lang['statistics_tab_streaks'] = "Streaks";
$lang['statistics_tab_weekdays'] = "Days of the week";
$lang['statistics_tab_daily'] = "Daily";
$lang['statistics_days_yearly'] = "Number of days with QSOs each year";
$lang['statistics_days_with_qso'] = "QSO'lu Günler";
$lang['statistics_qsos_each_day'] = "Number of QSOs each day";
$lang['statistics_weekdays_with_qso'] = "QSOs breakdown by day of the week";
$lang['statistics_number_of_qsos_this_day'] = "Number of QSOs this day";
$lang['statistics_number_of_qsos_this_weekday'] = "Number of QSOs for this day of the week";
$lang['statistics_dwq_longest_streak_in_log'] = "Günlükteki QSO'larla en uzun seri";
$lang['statistics_dwq_longest_streak_in_log_hint'] = "Maksimum en uzun 10 seri gösteriliyor!";

Wyświetl plik

@ -203,4 +203,44 @@ class Dayswithqso_model extends CI_Model
return $query->result();
}
/*
* Returns the number of QSOs made for each day in the log
*/
function getHistoryDays()
{
$CI =& get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
if (!$logbooks_locations_array) {
return null;
}
$min_date_query = $this->db->query('SELECT MIN(DATE(col_time_off)) AS min_date FROM ' . $this->config->item('table_name'));
$min_date = $min_date_query->row()->min_date;
$max_date_query = $this->db->query('SELECT MAX(DATE(col_time_off)) AS max_date FROM ' . $this->config->item('table_name'));
$max_date = $max_date_query->row()->max_date;
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$sql = "WITH RECURSIVE all_dates AS (
SELECT ? AS date
UNION ALL
SELECT DATE_ADD(date, INTERVAL 1 DAY)
FROM all_dates
WHERE DATE_ADD(date, INTERVAL 1 DAY) <= ?
)
SELECT all_dates.date AS day, COUNT(" . $this->config->item('table_name') . ".col_time_off) AS qsos
FROM all_dates
LEFT JOIN " . $this->config->item('table_name') . " ON DATE(" . $this->config->item('table_name') . ".col_time_off) = all_dates.date
AND station_id in (" . $location_list . ")
GROUP BY all_dates.date
ORDER BY all_dates.date";
$query = $this->db->query($sql, [$min_date, $max_date]);
$days = $query->result_array();
return $days;
}
}

Wyświetl plik

@ -1,5 +1,6 @@
<script>
var lang_days_with_qso = "<?php echo lang('statistics_days_with_qso'); ?>";
var lang_qsos_this_day = "<?php echo lang('statistics_number_of_qsos_this_day'); ?>";
var lang_qsos_this_weekday = "<?php echo lang('statistics_number_of_qsos_this_weekday'); ?>";
</script>
@ -19,6 +20,9 @@
<li class="nav-item">
<a class="nav-link" id="streaks-tab" data-bs-toggle="tab" href="#streaks" role="tab" aria-controls="streaks" aria-selected="false"><?php echo lang('statistics_tab_streaks'); ?></a>
</li>
<li class="nav-item">
<a class="nav-link" id="daily-tab" data-bs-toggle="tab" href="#daily" role="tab" aria-controls="daily" aria-selected="false"><?php echo lang('statistics_tab_daily'); ?></a>
</li>
</ul>
</div>
@ -152,5 +156,11 @@
}
?>
</div>
<div class="tab-pane fade" id="daily" role="tabpanel" aria-labelledby="daily-tab">
<br/>
<h3><?php echo lang('statistics_qsos_each_day'); ?></h3>
<canvas id="dailyChart" width="400" height="150"></canvas>
</div>
</div>
</div>

Wyświetl plik

@ -1,5 +1,6 @@
daysPerYear();
weekDays();
historyDays();
function daysPerYear() {
$.ajax({
@ -108,3 +109,61 @@ function weekDays() {
}
});
}
function historyDays() {
$.ajax({
url: base_url + 'index.php/dayswithqso/get_historydays',
success: function (data) {
if ($.trim(data)) {
var labels = [];
var dataDays = [];
$.each(data, function () {
labels.push(this.day);
dataDays.push(this.qsos);
});
var ctx = document.getElementById("dailyChart").getContext('2d');
var color = ifDarkModeThemeReturn('white', 'grey');
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: labels,
datasets: [{
label: lang_qsos_this_day,
data: dataDays,
pointRadius: 0,
pointHoverRadius: 6,
hitRadius: 4,
backgroundColor: 'rgba(54, 162, 235, 0.2)',
borderColor: 'rgba(54, 162, 235, 1)',
borderWidth: 2,
color: color
}]
},
options: {
scales: {
y: {
ticks: {
beginAtZero: true,
color: color,
precision: 0
}
},
x: {
ticks: {
color: color
}
}
},
plugins: {
legend: {
labels: {
color: color
}
}
}
}
});
}
}
});
}