const el = document.querySelector("#chart");
if (!el) {
alert("❌ #chart не найден");
return;
}
if (!window.ApexCharts) {
alert("❌ ApexCharts не подключён");
return;
}
const options = {
chart: { type: "line", height: 350 },
series: [{ name: "Продажи", data: [10, 20, 30, 40, 50] }],
xaxis: { categories: ["Пн", "Вт", "Ср", "Чт", "Пт"] }
};
const chart = new window.ApexCharts(el, options);
chart.render();