document.addEventListener("DOMContentLoaded", function() { var options = { chart: { height: 350, type: "line", zoom: { enabled: false }, toolbar: { show: false }, events: { mounted: function(chartContext, config) { setTimeout(() => { document.getElementsByClassName("apexcharts-subtitle-text")[0].addEventListener('click', clickDiv); }, 1000); } } }, title: { text: "Customs and Border Patrol Encounters (Seasonal)", align: 'left', margin: 0, offsetX: 0, offsetY: 0, floating: false, style: { fontSize: '14px', fontWeight: 'bold', fontFamily: undefined, color: '#263238' } }, subtitle: { text: '© govstats.us', align: 'right', margin: 0, offsetX: 0, offsetY: 45, // 295 floating: true, style: { fontSize: '11px', fontWeight: 'normal', fontFamily: undefined, color: '#AAA', background: '#FFF' }, }, series: [ { name: "2022", data: [187136, 198553, 205691, 186808, 190578, 250404, 262109, 274992, 247523, 238929, 251521, 272338] }, { name: "2023", data: [278317, 284624, 302392, 209151, 213911, 259471, 276036, 275166, 211457, 245154, 304073, 341392] }, { name: "2024", data: [309024, 308605, 370883, 242530, 256071, 246505, 247929, 240924, 204932, 170180, 158893, 144666] }, { name: "2025", data: [142943, 125173, 124734, 81792] } ], xaxis: { categories: ["OCT", "NOV", "DEC", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP"] } } var chart = new ApexCharts( document.querySelector("#chart"), options ); chart.render(); function clickDiv() { console.log("https://govstats.us/metric/cbp-seasonal"); } });