iEagle helps you plan your trip easily.
' + '
' + 'from: '+ ''+'$'+yLabels+'' + '
' + '
' } var oneWayOptions = { series: [{ name: 'from', data: oneWayPrices, }], //colors:['#a9e4d7','#00b595', '#E91E63'], colors: [function( {dataPointIndex, w, value}) { var dates = w.config.xaxis.categories[dataPointIndex]; return activeDateColor(dates,w,value); }], annotations: { points: [{ x: 'Mar', seriesIndex: 0, label: { borderColor: '#775DD0', offsetY: 0, style: { color: '#fff', background: '#775DD0', }, text: 'Bananas are good', } }] }, chart: { events: { dataPointSelection: function (event, chartContext, config) { var allLabelBars = document.querySelectorAll(".apexcharts-bar-area"); allLabelBars.forEach((x,c) =>{ allLabelBars[c].style.fill = '#00b595'; }) event.target.style.fill = `rgba(255, 116, 51)`; var dates = config.w.config.xaxis.categories[config.dataPointIndex]; var prices = config.w.config.series[0].data[config.dataPointIndex]; updatingDateValue(prices,dates,chartContext,config); }, dataPointMouseEnter: function (event, chartContext, config) { event.target.style.cursor ="pointer"; }, }, animations: { enabled: true, easing: 'easeinout', speed: 800, animateGradually: { enabled: true, delay: 150 }, dynamicAnimation: { enabled: true, speed: 350 } }, height: 350, type: "bar", //width: 600, toolbar: { show: false, } }, legend:{ show:false, }, plotOptions: { bar: { //colors:["#a9e4d7", "#b5e8dd", "#beede3", "#c5f0e6", "#cef2ea", "#dafa3", "#e8fef8"], columnWidth: '75%', borderRadius: 0, dataLabels: { position: "top", // top, center, bottom }, }, }, dataLabels: { enabled: false, formatter: function (val) { return "$" + val; }, offsetY: -20, style: { fontSize: "12px", colors: ["#304758"], }, }, xaxis: { categories: oneWayDates, position: "bottom", axisBorder: { show: false, }, labels:{ show:false, }, axisTicks: { show: false, }, crosshairs: { fill: { //colors:["#a9e4d7", "#b5e8dd", "#beede3", "#c5f0e6", "#cef2ea", "#dafa3", "#e8fef8"], width: 400, type: "gradient", colors: ['#F44336', '#E91E63', '#9C27B0'], gradient: { colorFrom: "#D8E3F0", colorTo: "#BED1E6", stops: [0, 100], opacityFrom: 0.4, opacityTo: 0.5, }, }, }, tooltip: { enabled: false, }, title: { text: oneWayText, offsetX: 0, offsetY: -25, style: { color: "#333", fontSize: '18px', fontFamily: 'Helvetica, Arial, sans-serif', fontWeight: 600, cssClass: 'apexcharts-xaxis-title', }, }, }, tooltip:{ enabled: true, custom: function({series, seriesIndex, dataPointIndex, w}) { return toolTipCustom(series, seriesIndex, dataPointIndex, w); } }, yaxis: { axisBorder: { show: false, }, axisTicks: { show: false, }, labels: { show: true, formatter: function (val) { return "$"+ val; }, style: { fontSize: '12px', fontWeight: 700, }, }, }, // title: { // text: "OneWay", // floating: true, // align: "left", // offsetX: 5, // offsetY: 0, // style: { // color: "#444", // marginBottom: "30px" // }, // }, }; var oneWayChart = new ApexCharts(document.querySelector("#chartOne"), oneWayOptions); oneWayChart.render();
var multiCityOptions = { series: [{ name: 'from', data: multiCityPrices, }], //colors:['#a9e4d7','#00b595', '#E91E63'], colors: [function({ dataPointIndex, value, w}) { var dates = w.config.xaxis.categories[dataPointIndex]; return activeDateColor(dates,w,value); }], chart: { events: { dataPointSelection: function (event, chartContext, config) { var dates = config.w.config.xaxis.categories[config.dataPointIndex]; var prices = config.w.config.series[0].data[config.dataPointIndex]; var allLabelBars = document.querySelectorAll(".apexcharts-bar-area"); allLabelBars.forEach((x,c) =>{ allLabelBars[c].style.fill = '#00b595'; }) event.target.style.fill = `rgba(255, 116, 51)`; updatingDateValue(prices,dates,chartContext,config); }, dataPointMouseEnter: function (event, chartContext, config) { event.target.style.cursor ="pointer"; } }, animations: { enabled: true, easing: 'easeinout', speed: 800, animateGradually: { enabled: true, delay: 150 }, dynamicAnimation: { enabled: true, speed: 350 } }, height: 350, type: "bar", // width: 700, toolbar: { show: false, } }, plotOptions: { bar: { columnWidth: '75%', borderRadius: 0, dataLabels: { position: "top", // top, center, bottom }, }, }, dataLabels: { enabled: false, formatter: function (val) { return "$"+val; }, offsetY: -20, style: { fontSize: "12px", colors: ["#304758"], }, }, xaxis: { categories: multiCityDates, position: "bottom", labels:{ show:false, }, axisBorder: { show: false, }, axisTicks: { show: false, }, crosshairs: { fill: { width: 400, type: "gradient", colors: ['#F44336', '#E91E63', '#9C27B0'], gradient: { colorFrom: "#D8E3F0", colorTo: "#BED1E6", stops: [0, 100], opacityFrom: 0.4, opacityTo: 0.5, }, }, }, tooltip: { enabled: false, }, title: { text: multiCityText, offsetX: 0, offsetY: -25, style: { color: "#333", fontSize: '18px', fontFamily: 'Helvetica, Arial, sans-serif', fontWeight: 600, cssClass: 'apexcharts-xaxis-title', }, }, }, tooltip:{ enabled: true, custom: function({series, seriesIndex, dataPointIndex, w}) { return toolTipCustom(series, seriesIndex, dataPointIndex, w); } }, yaxis: { axisBorder: { show: false, }, axisTicks: { show: false, }, labels: { show: true, formatter: function (val) { return "$" + val; }, style: { fontSize: '12px', fontWeight: 700, }, }, }, // title: { // text: "MultiCity", // floating: true, // offsetX: 5, // align: "left", // margin: 10, // style: { // color: "#444", // }, // }, }; var multiCityChart = new ApexCharts(document.querySelector("#chartThree"), multiCityOptions); multiCityChart.render();
var roundTripOptions = { series: [{ name: 'from', data: twoWayPrices, }], //colors:['#a9e4d7','#00b595', '#E91E63'], colors: [function( {dataPointIndex, w, value}) { var dates = w.config.xaxis.categories[dataPointIndex]; return activeDateColor(dates,w,value); }], chart: { events: { dataPointSelection: function (event, chartContext, config) { var dates = config.w.config.xaxis.categories[config.dataPointIndex]; var prices = config.w.config.series[0].data[config.dataPointIndex]; var allLabelBars = document.querySelectorAll(".apexcharts-bar-area"); allLabelBars.forEach((x,c) =>{ allLabelBars[c].style.fill = '#00b595'; }) event.target.style.fill = `rgba(255, 116, 51)`; updatingDateValue(prices,dates,chartContext,config); }, dataPointMouseEnter: function (event, chartContext, config) { event.target.style.cursor ="pointer"; } }, animations: { enabled: true, easing: 'easeinout', speed: 800, animateGradually: { enabled: true, delay: 150 }, dynamicAnimation: { enabled: true, speed: 350 } }, height: 350, type: "bar", //width: 700, toolbar: { show: false, } }, plotOptions: { bar: { columnWidth: '75%', borderRadius: 0, dataLabels: { position: "top", // top, center, bottom }, }, }, dataLabels: { enabled: false, formatter: function (val) { return "$" + val; }, offsetY: -20, style: { fontSize: "12px", colors: ["#304758"], }, }, xaxis: { categories: twoWayDates, position: "bottom", axisBorder: { show: false, }, labels:{ show:false, }, axisTicks: { show: false, }, crosshairs: { fill: { width: 400, type: "gradient", colors: ['#F44336', '#E91E63', '#9C27B0'], gradient: { colorFrom: "#D8E3F0", colorTo: "#BED1E6", stops: [0, 100], opacityFrom: 0.4, opacityTo: 0.5, }, }, }, tooltip: { enabled: false, }, title: { text: roundText, offsetX: 0, offsetY: -25, style: { color: "#333", fontSize: '18px', fontFamily: 'Helvetica, Arial, sans-serif', fontWeight: 600, cssClass: 'apexcharts-xaxis-title', }, }, }, tooltip:{ enabled: true, custom: function({series, seriesIndex, dataPointIndex, w}) { return toolTipCustom(series, seriesIndex, dataPointIndex, w); } }, yaxis: { axisBorder: { show: false, }, axisTicks: { show: false, }, labels: { show: true, formatter: function (val) { return "$"+ val; }, style: { fontSize: '12px', fontWeight: 700, }, }, }, // title: { // text: "Round Trip", // floating: true, // offsetX: 5, // align: "left", // margin: 10, // style: { // color: "#444", // } // }, }; var roundTripChart = new ApexCharts(document.querySelector("#chartTwo"), roundTripOptions); roundTripChart.render(); var allSliders = document.querySelectorAll(".apexSliders"); var itemCount = 0; var allSearchResultsDivs = document.querySelectorAll(".search-resultDiv"); var allFormBtns = document.querySelectorAll(".custom-btn"); var roundTripBtn = document.querySelector(".roundWay"); var onewayBtn = document.querySelector(".oneWay"); var multicityBtn = document.querySelector(".multiCity"); allFormBtns.forEach((b,i)=>{ b.addEventListener("click", function(){ allSliders.forEach((d,l)=>{ d.classList.remove("active"); }) allSliders[i].classList.add("active"); if(roundTripBtn.classList.contains("active")){ itemCount = 0; prevBtn.style.cssText = "cursor:not-allowed;pointer-events:none;opacity:0.5"; nextBtn.style.cssText = "cursor:pointer;pointer-events:all;opacity:1"; } else if(onewayBtn.classList.contains("active")){ itemCount = 1; prevBtn.style.cssText = "cursor:pointer;pointer-events:all;opacity:1"; nextBtn.style.cssText = "cursor:pointer;pointer-events:all;opacity:1"; } else if(multicityBtn.classList.contains("active")){ itemCount = 2; prevBtn.style.cssText = "cursor:pointer;pointer-events:all;opacity:1"; nextBtn.style.cssText = "cursor:not-allowed;pointer-events:none;opacity:0.5"; } }) }) var nextBtn = document.querySelector(".next"); var prevBtn = document.querySelector(".prev"); var totalItems = allSliders.length; prevBtn.style.cssText = "cursor:not-allowed;pointer-events:none;opacity:0.2"; nextBtn.onclick = function () { nextSlide("next"); } prevBtn.onclick = function () { nextSlide("prev"); } var nextSlide = function (dir) { if (dir == "next") { itemCount++; if (itemCount > 0) { prevBtn.style.cssText = "cursor:pointer;pointer-events:all;opacity:1"; } if(itemCount == totalItems-1){ nextBtn.style.cssText = "cursor:not-allowed;pointer-events:none;opacity:0.2"; } if (itemCount == totalItems) { itemCount = 0; } } else { if (itemCount == 0) { itemCount = totalItems - 1; } else { itemCount--; nextBtn.style.cssText = "cursor:pointer;pointer-events:all;opacity:1"; } } //sliding effect for apexchart allSliders.forEach((x,v)=>{ x.classList.remove("active"); }) allSliders[itemCount].classList.add("active"); //changing the form navigation according to apexchart if(itemCount == 0){ changeTrip("RT"); prevBtn.style.cssText = "cursor:not-allowed;pointer-events:none;opacity:0.2"; } if (itemCount == 1){ changeTrip("OW"); } if (itemCount == 2){ changeTrip("MC"); } allSearchResultsDivs.forEach((a,b)=>{ a.style.display="none"; }) allSearchResultsDivs[itemCount].style.display="block"; allFormBtns.forEach((d,i)=>{ d.classList.remove("active"); }) allFormBtns[itemCount].classList.add("active"); } //When user press enter key the Search flights function will call $("#flightSearch").on('keyup', function (e) { if (e.keyCode == 13) { showFlightsByAirline(flightSearch); } });