document.addEventListener("DOMContentLoaded", function() { var options = { chart: { height: 350, type: "area", zoom: { enabled: false }, toolbar: { show: false }, events: { mounted: function(chartContext, config) { setTimeout(() => { document.getElementsByClassName("apexcharts-subtitle-text")[0].addEventListener('click', clickDiv); }, 1000); } } }, title: { text: "area", 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: "Series 1", data: [45, 52, 38, 45, 19, 23, 2] } ], xaxis: { categories: [ "01 Jan", "02 Jan", "03 Jan", "04 Jan", "05 Jan", "06 Jan", "07 Jan" ] } ,fill: { type: "gradient", gradient: { shadeIntensity: 1, opacityFrom: 0.7, opacityTo: 0.9, stops: [0, 90, 100] } } } var chart = new ApexCharts( document.querySelector("#chart"), options ); chart.render(); function clickDiv() { console.log("https://govstats.us/metric/area"); } });