diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index ba6f6817..5608b17d 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -782,43 +782,7 @@ $(document).ready(function(){ uri->segment(1) == "dayswithqso") { ?> - + uri->segment(1) == "distances") { ?> @@ -826,111 +790,7 @@ $(document).ready(function(){ - + uri->segment(2) == "import") { ?> @@ -946,100 +806,51 @@ $(document).ready(function(){ uri->segment(1) == "qrz") { ?> - + - + } + }); + } + uri->segment(2) == "dxcc") { ?> diff --git a/assets/js/sections/dayswithqso.js b/assets/js/sections/dayswithqso.js new file mode 100644 index 00000000..361d5ec0 --- /dev/null +++ b/assets/js/sections/dayswithqso.js @@ -0,0 +1,34 @@ +$.ajax({ + url: base_url+'index.php/dayswithqso/get_days', + success: function(data) { + var labels = []; + var dataDxcc = []; + $.each(data, function(){ + labels.push(this.Year); + dataDxcc.push(this.Days); + }); + var ctx = document.getElementById("myChartDiff").getContext('2d'); + var myChart = new Chart(ctx, { + type: 'bar', + data: { + labels: labels, + datasets: [{ + label: 'Days with QSOs', + data: dataDxcc, + backgroundColor: 'rgba(54, 162, 235, 0.2)', + borderColor: 'rgba(54, 162, 235, 1)', + borderWidth: 2 + }] + }, + options: { + scales: { + yAxes: [{ + ticks: { + beginAtZero:true + } + }] + }, + } + }); + } +}); diff --git a/assets/js/sections/distances.js b/assets/js/sections/distances.js new file mode 100644 index 00000000..95e409b8 --- /dev/null +++ b/assets/js/sections/distances.js @@ -0,0 +1,101 @@ +$('#distplot_bands').change(function(){ + var band = $("#distplot_bands option:selected").text(); + if (band != "SAT") { + $("#distplot_sats").prop('disabled', true); + } else { + $("#distplot_sats").prop('disabled', false); + } +}); + +function distPlot(form) { + $(".alert").remove(); + var baseURL= ""; + $.ajax({ + url: base_url+'index.php/distances/get_distances', + type: 'post', + data: {'band': form.distplot_bands.value, + 'sat': form.distplot_sats.value}, + success: function(tmp) { + if (tmp.ok == 'OK') { + if (!($('#information').length > 0)) + $("#distances_div").append('
'); + var options = { + chart: { + type: 'column', + zoomType: 'xy', + renderTo: 'graphcontainer' + }, + title: { + text: 'Distance Distribution' + }, + xAxis: { + categories: [], + crosshair: true, + type: "category", + min:0, + max:100 + + }, + yAxis: { + title: { + text: '# QSOs' + } + }, + navigator: { + enabled: true, + xAxis: { + labels: { + formatter: function() { + return this.value * '50' + ' ' + tmp.unit; + } + } + } + }, + rangeSelector: { + selected: 1 + }, + tooltip: { + formatter: function () { + if(this.point) { + return "Distance: " + options.xAxis.categories[this.point.x] + + "