Initial commit

This commit is contained in:
2025-12-22 12:03:01 +07:00
commit 10dc345147
367 changed files with 31188 additions and 0 deletions

51
resources/js/app.js Normal file
View File

@@ -0,0 +1,51 @@
import './bootstrap';
import Alpine from 'alpinejs';
import ApexCharts from 'apexcharts';
// flatpickr
import flatpickr from 'flatpickr';
import 'flatpickr/dist/flatpickr.min.css';
// FullCalendar
import { Calendar } from '@fullcalendar/core';
window.Alpine = Alpine;
window.ApexCharts = ApexCharts;
window.flatpickr = flatpickr;
window.FullCalendar = Calendar;
Alpine.start();
// Initialize components on DOM ready
document.addEventListener('DOMContentLoaded', () => {
// Map imports
if (document.querySelector('#mapOne')) {
import('./components/map').then(module => module.initMap());
}
// Chart imports
if (document.querySelector('#chartOne')) {
import('./components/chart/chart-1').then(module => module.initChartOne());
}
if (document.querySelector('#chartTwo')) {
import('./components/chart/chart-2').then(module => module.initChartTwo());
}
if (document.querySelector('#chartThree')) {
import('./components/chart/chart-3').then(module => module.initChartThree());
}
if (document.querySelector('#chartSix')) {
import('./components/chart/chart-6').then(module => module.initChartSix());
}
if (document.querySelector('#chartEight')) {
import('./components/chart/chart-8').then(module => module.initChartEight());
}
if (document.querySelector('#chartThirteen')) {
import('./components/chart/chart-13').then(module => module.initChartThirteen());
}
// Calendar init
if (document.querySelector('#calendar')) {
import('./components/calendar-init').then(module => module.calendarInit());
}
});

4
resources/js/bootstrap.js vendored Normal file
View File

@@ -0,0 +1,4 @@
import axios from 'axios';
window.axios = axios;
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

View File

@@ -0,0 +1,352 @@
import { Calendar } from "@fullcalendar/core";
import dayGridPlugin from "@fullcalendar/daygrid";
import listPlugin from "@fullcalendar/list";
import timeGridPlugin from "@fullcalendar/timegrid";
import interactionPlugin from "@fullcalendar/interaction";
export function calendarInit() {
const calendarWrapper = document.querySelector("#calendar");
if (calendarWrapper) {
// Calendar Date variable
const newDate = new Date();
const getDynamicMonth = () => {
const month = newDate.getMonth() + 1;
return month < 10 ? `0${month}` : `${month}`;
};
// Calendar Modal Elements
const getModalTitleEl = document.querySelector("#event-title");
const getModalStartDateEl = document.querySelector("#event-start-date");
const getModalEndDateEl = document.querySelector("#event-end-date");
const getModalAddBtnEl = document.querySelector(".btn-add-event");
const getModalUpdateBtnEl = document.querySelector(".btn-update-event");
const getModalHeaderEl = document.querySelector("#eventModalLabel");
const calendarsEvents = {
Danger: "danger",
Success: "success",
Primary: "primary",
Warning: "warning",
};
// Calendar Elements and options
const calendarEl = document.querySelector("#calendar");
const calendarHeaderToolbar = {
left: "prev,next addEventButton",
center: "title",
right: "dayGridMonth,timeGridWeek,timeGridDay",
};
const calendarEventsList = [
{
id: "1",
title: "Event Conf.",
start: `${newDate.getFullYear()}-${getDynamicMonth()}-01`,
extendedProps: { calendar: "Danger" },
},
{
id: "2",
title: "Seminar #4",
start: `${newDate.getFullYear()}-${getDynamicMonth()}-07`,
end: `${newDate.getFullYear()}-${getDynamicMonth()}-10`,
extendedProps: { calendar: "Success" },
},
{
id: "3",
title: "Meeting #5",
start: `${newDate.getFullYear()}-${getDynamicMonth()}-09T16:00:00`,
extendedProps: { calendar: "Primary" },
},
{
id: "4",
title: "Submission #1",
start: `${newDate.getFullYear()}-${getDynamicMonth()}-16T16:00:00`,
extendedProps: { calendar: "Warning" },
},
{
id: "5",
title: "Seminar #6",
start: `${newDate.getFullYear()}-${getDynamicMonth()}-11`,
end: `${newDate.getFullYear()}-${getDynamicMonth()}-13`,
extendedProps: { calendar: "Danger" },
},
];
// Modal Functions
const openModal = () => {
const modal = document.getElementById("eventModal");
if (modal) {
modal.style.display = "flex";
document.body.style.overflow = "hidden"; // Prevent background scroll
}
};
const closeModal = () => {
const modal = document.getElementById("eventModal");
if (modal) {
modal.style.display = "none";
document.body.style.overflow = ""; // Restore scroll
}
resetModalFields();
};
// Reset modal fields
function resetModalFields() {
if (getModalTitleEl) getModalTitleEl.value = "";
if (getModalStartDateEl) getModalStartDateEl.value = "";
if (getModalEndDateEl) getModalEndDateEl.value = "";
const getModalIfCheckedRadioBtnEl = document.querySelector(
'input[name="event-level"]:checked'
);
if (getModalIfCheckedRadioBtnEl) {
getModalIfCheckedRadioBtnEl.checked = false;
}
}
// Calendar Select function (when user clicks/drags on calendar)
const calendarSelect = (info) => {
resetModalFields();
// Update modal header
if (getModalHeaderEl) {
getModalHeaderEl.textContent = "Add Event";
}
// Show Add button, hide Update button
if (getModalAddBtnEl) getModalAddBtnEl.style.display = "flex";
if (getModalUpdateBtnEl) getModalUpdateBtnEl.style.display = "none";
// Set dates from selection
if (getModalStartDateEl) getModalStartDateEl.value = info.startStr;
if (getModalEndDateEl) {
getModalEndDateEl.value = info.endStr || info.startStr;
}
openModal();
};
// Calendar AddEvent button click
const calendarAddEvent = () => {
resetModalFields();
// Update modal header
if (getModalHeaderEl) {
getModalHeaderEl.textContent = "Add Event";
}
// Show Add button, hide Update button
if (getModalAddBtnEl) getModalAddBtnEl.style.display = "flex";
if (getModalUpdateBtnEl) getModalUpdateBtnEl.style.display = "none";
// Set default start date to today
const currentDate = new Date();
const yyyy = currentDate.getFullYear();
const mm = String(currentDate.getMonth() + 1).padStart(2, "0");
const dd = String(currentDate.getDate()).padStart(2, "0");
const combineDate = `${yyyy}-${mm}-${dd}`;
if (getModalStartDateEl) getModalStartDateEl.value = combineDate;
openModal();
};
// Calendar Event Click function (when user clicks existing event)
const calendarEventClick = (info) => {
const eventObj = info.event;
if (eventObj.url) {
window.open(eventObj.url);
info.jsEvent.preventDefault();
} else {
resetModalFields();
// Update modal header
if (getModalHeaderEl) {
getModalHeaderEl.textContent = "Edit Event";
}
// Get event details
const getModalEventId = eventObj.id;
const getModalEventLevel = eventObj.extendedProps.calendar;
// Set form values
if (getModalTitleEl) getModalTitleEl.value = eventObj.title;
if (getModalStartDateEl) {
getModalStartDateEl.value = eventObj.startStr.split("T")[0];
}
if (getModalEndDateEl) {
getModalEndDateEl.value = eventObj.endStr
? eventObj.endStr.split("T")[0]
: "";
}
// Check the correct radio button
const getModalCheckedRadioBtnEl = document.querySelector(
`input[value="${getModalEventLevel}"]`
);
if (getModalCheckedRadioBtnEl) {
getModalCheckedRadioBtnEl.checked = true;
}
// Store event ID for update
if (getModalUpdateBtnEl) {
getModalUpdateBtnEl.dataset.fcEventPublicId = getModalEventId;
}
// Hide Add button, show Update button
if (getModalAddBtnEl) getModalAddBtnEl.style.display = "none";
if (getModalUpdateBtnEl) getModalUpdateBtnEl.style.display = "flex";
openModal();
}
};
// Initialize Calendar
const calendar = new Calendar(calendarEl, {
plugins: [dayGridPlugin, timeGridPlugin, listPlugin, interactionPlugin],
selectable: true,
initialView: "dayGridMonth",
initialDate: `${newDate.getFullYear()}-${getDynamicMonth()}-07`,
headerToolbar: calendarHeaderToolbar,
events: calendarEventsList,
select: calendarSelect,
eventClick: calendarEventClick,
displayEventTime: false, // Hide time display
customButtons: {
addEventButton: {
text: "Add Event +",
click: calendarAddEvent,
},
},
// eventClassNames({ event: calendarEvent }) {
// const getColorValue =
// calendarsEvents[calendarEvent._def.extendedProps.calendar];
// return [`event-fc-color`, `fc-bg-${getColorValue}`];
// },
// Optional: Custom event content without time
eventContent(eventInfo) {
const colorClass = `fc-bg-${eventInfo.event.extendedProps.calendar.toLowerCase()}`
return {
html: `
<div class="event-fc-color flex fc-event-main ${colorClass} p-1 rounded-sm">
<div class="fc-daygrid-event-dot"></div>
<div class="fc-event-time">${eventInfo.timeText}</div>
<div class="fc-event-title">${eventInfo.event.title}</div>
</div>
`,
}
},
});
// Update Calendar Event
// if (getModalUpdateBtnEl) {
// getModalUpdateBtnEl.addEventListener("click", () => {
// const getPublicID = getModalUpdateBtnEl.dataset.fcEventPublicId;
// const getTitleUpdatedValue = getModalTitleEl.value;
// const setModalStartDateValue = getModalStartDateEl.value;
// const setModalEndDateValue = getModalEndDateEl.value;
// const getEvent = calendar.getEventById(getPublicID);
// const getModalUpdatedCheckedRadioBtnEl = document.querySelector(
// 'input[name="event-level"]:checked'
// );
// const getModalUpdatedCheckedRadioBtnValue =
// getModalUpdatedCheckedRadioBtnEl
// ? getModalUpdatedCheckedRadioBtnEl.value
// : "";
// if (getEvent) {
// getEvent.setProp("title", getTitleUpdatedValue);
// getEvent.setDates(setModalStartDateValue, setModalEndDateValue);
// getEvent.setExtendedProp("calendar", getModalUpdatedCheckedRadioBtnValue);
// }
// closeModal();
// });
// }
if (getModalUpdateBtnEl) {
getModalUpdateBtnEl.addEventListener("click", () => {
const getPublicID = getModalUpdateBtnEl.dataset.fcEventPublicId;
const getTitleUpdatedValue = getModalTitleEl.value;
const setModalStartDateValue = getModalStartDateEl.value;
const setModalEndDateValue = getModalEndDateEl.value;
const getEvent = calendar.getEventById(getPublicID);
const getModalUpdatedCheckedRadioBtnEl = document.querySelector(
'input[name="event-level"]:checked'
);
const getModalUpdatedCheckedRadioBtnValue =
getModalUpdatedCheckedRadioBtnEl
? getModalUpdatedCheckedRadioBtnEl.value
: "";
if (getEvent) {
// Remove the old event
getEvent.remove();
// Add updated event with all properties
calendar.addEvent({
id: getPublicID,
title: getTitleUpdatedValue,
start: setModalStartDateValue,
end: setModalEndDateValue,
allDay: true,
extendedProps: { calendar: getModalUpdatedCheckedRadioBtnValue },
});
}
closeModal();
});
}
// Add Calendar Event
if (getModalAddBtnEl) {
getModalAddBtnEl.addEventListener("click", () => {
const getModalCheckedRadioBtnEl = document.querySelector(
'input[name="event-level"]:checked'
);
const getTitleValue = getModalTitleEl.value;
const setModalStartDateValue = getModalStartDateEl.value;
const setModalEndDateValue = getModalEndDateEl.value;
const getModalCheckedRadioBtnValue = getModalCheckedRadioBtnEl
? getModalCheckedRadioBtnEl.value
: "";
calendar.addEvent({
id: Date.now().toString(),
title: getTitleValue,
start: setModalStartDateValue,
end: setModalEndDateValue,
allDay: true,
extendedProps: { calendar: getModalCheckedRadioBtnValue },
});
closeModal();
});
}
// Render Calendar
calendar.render();
// Close modal event listeners
document.querySelectorAll(".modal-close-btn").forEach((btn) => {
btn.addEventListener("click", closeModal);
});
// Close when clicking outside modal
window.addEventListener("click", (event) => {
const modal = document.getElementById("eventModal");
if (event.target === modal) {
closeModal();
}
});
}
}
export default calendarInit;

View File

@@ -0,0 +1,100 @@
export const initChartOne = () => {
const chartElement = document.querySelector('#chartOne');
if (!chartElement) return;
const chartOneOptions = {
series: [{
name: "Sales",
data: [168, 385, 201, 298, 187, 195, 291, 110, 215, 390, 280, 112],
},],
colors: ["#465fff"],
chart: {
fontFamily: "Outfit, sans-serif",
type: "bar",
height: 180,
toolbar: {
show: false,
},
},
plotOptions: {
bar: {
horizontal: false,
columnWidth: "39%",
borderRadius: 5,
borderRadiusApplication: "end",
},
},
dataLabels: {
enabled: false,
},
stroke: {
show: true,
width: 4,
colors: ["transparent"],
},
xaxis: {
categories: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
axisBorder: {
show: false,
},
axisTicks: {
show: false,
},
},
legend: {
show: true,
position: "top",
horizontalAlign: "left",
fontFamily: "Outfit",
markers: {
radius: 99,
},
},
yaxis: {
title: false,
},
grid: {
yaxis: {
lines: {
show: true,
},
},
},
fill: {
opacity: 1,
},
tooltip: {
x: {
show: false,
},
y: {
formatter: function (val) {
return val;
},
},
},
};
const chart = new ApexCharts(chartElement, chartOneOptions);
chart.render();
return chart;
};
export default initChartOne;

View File

@@ -0,0 +1,332 @@
export function initChartThirteen() {
const chartThirteenEl = document.querySelector("#chartThirteen");
if (chartThirteenEl) {
const data = [
[1746153600000, 30.95],
[1746240000000, 31.34],
[1746326400000, 31.18],
[1746412800000, 31.05],
[1746672000000, 31.0],
[1746758400000, 30.95],
[1746844800000, 31.24],
[1746931200000, 31.29],
[1747017600000, 31.85],
[1747276800000, 31.86],
[1747363200000, 32.28],
[1747449600000, 32.1],
[1747536000000, 32.65],
[1747622400000, 32.21],
[1747881600000, 32.35],
[1747968000000, 32.44],
[1748054400000, 32.46],
[1748140800000, 32.86],
[1748227200000, 32.75],
[1748572800000, 32.54],
[1748659200000, 32.33],
[1748745600000, 32.97],
[1748832000000, 33.41],
[1749091200000, 33.27],
[1749177600000, 33.27],
[1749264000000, 32.89],
[1749350400000, 33.1],
[1749436800000, 33.73],
[1749696000000, 33.22],
[1749782400000, 31.99],
[1749868800000, 32.41],
[1749955200000, 33.05],
[1750041600000, 33.64],
[1750300800000, 33.56],
[1750387200000, 34.22],
[1750473600000, 33.77],
[1750560000000, 34.17],
[1750646400000, 33.82],
[1750905600000, 34.51],
[1750992000000, 33.16],
[1751078400000, 33.56],
[1751164800000, 33.71],
[1751251200000, 33.81],
[1751506800000, 34.4],
[1751593200000, 34.63],
[1751679600000, 34.46],
[1751766000000, 34.48],
[1751852400000, 34.31],
[1752111600000, 34.7],
[1752198000000, 34.31],
[1752284400000, 33.46],
[1752370800000, 33.59],
[1752716400000, 33.22],
[1752802800000, 32.61],
[1752889200000, 33.01],
[1752975600000, 33.55],
[1753062000000, 33.18],
[1753321200000, 32.84],
[1753407600000, 33.84],
[1753494000000, 33.39],
[1753580400000, 32.91],
[1753666800000, 33.06],
[1753926000000, 32.62],
[1754012400000, 32.4],
[1754098800000, 33.13],
[1754185200000, 33.26],
[1754271600000, 33.58],
[1754530800000, 33.55],
[1754617200000, 33.77],
[1754703600000, 33.76],
[1754790000000, 33.32],
[1754876400000, 32.61],
[1755135600000, 32.52],
[1755222000000, 32.67],
[1755308400000, 32.52],
[1755394800000, 31.92],
[1755481200000, 32.2],
[1755740400000, 32.23],
[1755826800000, 32.33],
[1755913200000, 32.36],
[1755999600000, 32.01],
[1756086000000, 31.31],
[1756345200000, 32.01],
[1756431600000, 32.01],
[1756518000000, 32.18],
[1756604400000, 31.54],
[1756690800000, 31.6],
[1757036400000, 32.05],
[1757122800000, 31.29],
[1757209200000, 31.05],
[1757295600000, 29.82],
[1757554800000, 30.31],
[1757641200000, 30.7],
[1757727600000, 31.69],
[1757814000000, 31.32],
[1757900400000, 31.65],
[1758159600000, 31.13],
[1758246000000, 31.77],
[1758332400000, 31.79],
[1758418800000, 31.67],
[1758505200000, 32.39],
[1758764400000, 32.63],
[1758850800000, 32.89],
[1758937200000, 31.99],
[1759023600000, 31.23],
[1759110000000, 31.57],
[1759369200000, 30.84],
[1759455600000, 31.07],
[1759542000000, 31.41],
[1759628400000, 31.17],
[1759714800000, 32.37],
[1759974000000, 32.19],
[1760060400000, 32.51],
[1760233200000, 32.53],
[1760319600000, 31.37],
[1760578800000, 30.43],
[1760665200000, 30.44],
[1760751600000, 30.2],
[1760838000000, 30.14],
[1760924400000, 30.65],
[1761183600000, 30.4],
[1761270000000, 30.65],
[1761356400000, 31.43],
[1761442800000, 31.89],
[1761529200000, 31.38],
[1761788400000, 30.64],
[1761874800000, 30.02],
[1761961200000, 30.33],
[1762047600000, 30.95],
[1762134000000, 31.89],
[1762393200000, 31.01],
[1762479600000, 30.88],
[1762566000000, 30.69],
[1762652400000, 30.58],
[1762738800000, 32.02],
[1762998000000, 32.14],
[1763084400000, 32.37],
[1763170800000, 32.51],
[1763257200000, 32.65],
[1763343600000, 32.64],
[1763602800000, 32.27],
[1763689200000, 32.1],
[1763775600000, 32.91],
[1763862000000, 33.65],
[1763948400000, 33.8],
[1764207600000, 33.92],
[1764294000000, 33.75],
[1764380400000, 33.84],
[1764466800000, 33.5],
[1764553200000, 32.26],
[1764812400000, 32.32],
[1764898800000, 32.06],
[1764985200000, 31.96],
[1765071600000, 31.46],
[1765158000000, 31.27],
[1765503600000, 31.43],
[1765590000000, 32.26],
[1765676400000, 32.79],
[1765762800000, 32.46],
[1766022000000, 32.13],
[1766108400000, 32.43],
[1766194800000, 32.42],
[1766281200000, 32.81],
[1766367600000, 33.34],
[1766626800000, 33.41],
[1766713200000, 32.57],
[1766799600000, 33.12],
[1766886000000, 34.53],
[1766972400000, 33.83],
[1767231600000, 33.41],
[1767318000000, 32.9],
[1767404400000, 32.53],
[1767490800000, 32.8],
[1767577200000, 32.44],
[1767836400000, 32.62],
[1767922800000, 32.57],
[1768009200000, 32.6],
[1768095600000, 32.68],
[1768182000000, 32.47],
[1768441200000, 32.23],
[1768527600000, 31.68],
[1768614000000, 31.51],
[1768700400000, 31.78],
[1768786800000, 31.94],
[1769046000000, 32.33],
[1769132400000, 33.24],
[1769218800000, 33.44],
[1769305200000, 33.48],
[1769391600000, 33.24],
[1769650800000, 33.49],
[1769737200000, 33.31],
[1769823600000, 33.36],
[1769910000000, 33.4],
[1769996400000, 34.01],
[1770432000000, 34.02],
[1770518400000, 34.36],
[1770604800000, 34.39],
[1770864000000, 34.24],
[1770950400000, 34.39],
[1771036800000, 33.47],
[1771123200000, 32.98],
[1771209600000, 32.9],
[1771468800000, 32.7],
[1771555200000, 32.54],
[1771641600000, 32.23],
[1771728000000, 32.64],
[1771814400000, 32.65],
[1772073600000, 32.92],
[1772160000000, 32.64],
[1772246400000, 32.84],
[1772419200000, 33.4],
[1772678400000, 33.3],
[1772764800000, 33.18],
[1772851200000, 33.88],
[1772937600000, 34.09],
[1773024000000, 34.61],
[1773283200000, 34.7],
[1773369600000, 35.3],
[1773456000000, 35.4],
[1773542400000, 35.14],
[1773628800000, 35.48],
[1773888000000, 35.75],
[1773974400000, 35.54],
[1774060800000, 35.96],
[1774147200000, 35.53],
[1774233600000, 37.56],
[1774492800000, 37.42],
[1774579200000, 37.49],
[1774665600000, 38.09],
[1774752000000, 37.87],
];
const chartOptions = {
series: [
{
name: "Portfolio Performance",
data: data,
},
],
legend: {
show: false,
position: "top",
horizontalAlign: "left",
},
colors: ["#465FFF"],
chart: {
fontFamily: "Outfit, sans-serif",
height: 335,
id: "area-datetime",
type: "area",
toolbar: {
show: false,
},
},
stroke: {
curve: "straight",
width: ["1", "1"],
},
dataLabels: {
enabled: false,
},
markers: {
size: 0,
},
labels: {
show: false,
position: "top",
},
xaxis: {
type: "datetime",
tickAmount: 10,
axisBorder: {
show: false,
},
axisTicks: {
show: false,
},
tooltip: false,
},
tooltip: {
x: {
format: "dd MMM yyyy",
},
},
fill: {
gradient: {
enabled: true,
opacityFrom: 0.55,
opacityTo: 0,
},
},
grid: {
xaxis: {
lines: {
show: false,
},
},
yaxis: {
lines: {
show: true,
},
},
},
yaxis: {
title: {
style: {
fontSize: "0px",
},
},
},
};
const chartThirteen = new ApexCharts(chartThirteenEl, chartOptions);
chartThirteen.render();
return chartThirteen;
}
}
export default initChartThirteen;

View File

@@ -0,0 +1,61 @@
export const initChartTwo = () => {
const chartElement = document.querySelector('#chartTwo');
if (chartElement) {
const chartTwoOptions = {
series: [75.55],
colors: ["#465FFF"],
chart: {
fontFamily: "Outfit, sans-serif",
type: "radialBar",
height: 330,
sparkline: {
enabled: true,
},
},
plotOptions: {
radialBar: {
startAngle: -90,
endAngle: 90,
hollow: {
size: "80%",
},
track: {
background: "#E4E7EC",
strokeWidth: "100%",
margin: 5, // margin is in pixels
},
dataLabels: {
name: {
show: false,
},
value: {
fontSize: "36px",
fontWeight: "600",
offsetY: 60,
color: "#1D2939",
formatter: function (val) {
return val + "%";
},
},
},
},
},
fill: {
type: "solid",
colors: ["#465FFF"],
},
stroke: {
lineCap: "round",
},
labels: ["Progress"],
};
const chart = new ApexCharts(chartElement, chartTwoOptions);
chart.render();
return chart;
}
}
export default initChartTwo;

View File

@@ -0,0 +1,107 @@
export const initChartThree = () => {
const chartElement = document.querySelector('#chartThree');
if (chartElement) {
const chartThreeOptions = {
series: [{
name: "Sales",
data: [180, 190, 170, 160, 175, 165, 170, 205, 230, 210, 240, 235],
},
{
name: "Revenue",
data: [40, 30, 50, 40, 55, 40, 70, 100, 110, 120, 150, 140],
},
],
legend: {
show: false,
position: "top",
horizontalAlign: "left",
},
colors: ["#465FFF", "#9CB9FF"],
chart: {
fontFamily: "Outfit, sans-serif",
height: 310,
type: "area",
toolbar: {
show: false,
},
},
fill: {
gradient: {
enabled: true,
opacityFrom: 0.55,
opacityTo: 0,
},
},
stroke: {
curve: "straight",
width: ["2", "2"],
},
markers: {
size: 0,
},
labels: {
show: false,
position: "top",
},
grid: {
xaxis: {
lines: {
show: false,
},
},
yaxis: {
lines: {
show: true,
},
},
},
dataLabels: {
enabled: false,
},
tooltip: {
x: {
format: "dd MMM yyyy",
},
},
xaxis: {
type: "category",
categories: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
axisBorder: {
show: false,
},
axisTicks: {
show: false,
},
tooltip: false,
},
yaxis: {
title: {
style: {
fontSize: "0px",
},
},
},
};
const chart = new ApexCharts(chartElement, chartThreeOptions);
chart.render();
return chart;
}
}
export default initChartThree;

View File

@@ -0,0 +1,107 @@
export function initChartSix() {
const chartSixEl = document.querySelector('#chartSix');
if (chartSixEl) {
const chartSixOptions = {
series: [
{
name: "Direct",
data: [44, 55, 41, 67, 22, 43, 55, 41],
},
{
name: "Referral",
data: [13, 23, 20, 8, 13, 27, 13, 23],
},
{
name: "Organic Search",
data: [11, 17, 15, 15, 21, 14, 18, 20],
},
{
name: "Social",
data: [21, 7, 25, 13, 22, 8, 18, 20],
},
],
colors: ["#2a31d8", "#465fff", "#7592ff", "#c2d6ff"],
chart: {
fontFamily: "Outfit, sans-serif",
type: "bar",
stacked: true,
height: 315,
toolbar: {
show: false,
},
zoom: {
enabled: false,
},
},
plotOptions: {
bar: {
horizontal: false,
columnWidth: "39%",
borderRadius: 10,
borderRadiusApplication: "end",
borderRadiusWhenStacked: "last",
},
},
dataLabels: {
enabled: false,
},
xaxis: {
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug"],
axisBorder: {
show: false,
},
axisTicks: {
show: false,
},
},
legend: {
show: true,
position: "top",
horizontalAlign: "left",
fontFamily: "Outfit",
fontSize: "14px",
fontWeight: 400,
markers: {
size: 5,
shape: "circle",
radius: 999,
strokeWidth: 0,
},
itemMargin: {
horizontal: 10,
vertical: 0,
},
},
yaxis: {
title: false,
},
grid: {
yaxis: {
lines: {
show: true,
},
},
},
fill: {
opacity: 1,
},
tooltip: {
x: {
show: false,
},
y: {
formatter: function (val) {
return val;
},
},
},
};
const chartSix = new ApexCharts(chartSixEl, chartSixOptions);
chartSix.render();
return chartSix;
}
}

View File

@@ -0,0 +1,108 @@
export function initChartEight() {
const chartEightEl = document.querySelector('#chartEight');
if (chartEightEl) {
const chartEightOptions = {
series: [
{
name: "Sales",
data: [180, 190, 170, 160, 175, 165, 170, 205, 230, 210, 240, 235],
},
{
name: "Revenue",
data: [40, 30, 50, 40, 55, 40, 70, 100, 110, 120, 150, 140],
},
],
legend: {
show: false,
position: "top",
horizontalAlign: "left",
},
colors: ["#465FFF", "#9CB9FF"],
chart: {
fontFamily: "Outfit, sans-serif",
height: 310,
type: "area",
toolbar: {
show: false,
},
},
fill: {
gradient: {
enabled: true,
opacityFrom: 0.55,
opacityTo: 0,
},
},
stroke: {
curve: "smooth",
width: ["2", "2"],
},
markers: {
size: 0,
},
labels: {
show: false,
position: "top",
},
grid: {
xaxis: {
lines: {
show: false,
},
},
yaxis: {
lines: {
show: true,
},
},
},
dataLabels: {
enabled: false,
},
tooltip: {
x: {
format: "dd MMM yyyy",
},
},
xaxis: {
type: "category",
categories: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
axisBorder: {
show: false,
},
axisTicks: {
show: false,
},
tooltip: false,
},
yaxis: {
title: {
style: {
fontSize: "0px",
},
},
},
};
const chartEight = new ApexCharts(chartEightEl, chartEightOptions);
chartEight.render();
return chartEight;
}
}
export default initChartEight;

View File

@@ -0,0 +1,63 @@
import jsVectorMap from 'jsvectormap';
import 'jsvectormap/dist/maps/world';
import 'jsvectormap/dist/jsvectormap.min.css';
export const initMap = () => {
const mapSelectorOne = document.querySelectorAll('#mapOne');
if (mapSelectorOne.length) {
const mapOne = new jsVectorMap({
selector: "#mapOne",
map: "world",
zoomButtons: false,
regionStyle: {
initial: {
fontFamily: "Outfit",
fill: "#D9D9D9",
},
hover: {
fillOpacity: 1,
fill: "#465fff",
},
},
markers: [
{
name: "Egypt",
coords: [26.8206, 30.8025],
},
{
name: "United Kingdom",
coords: [55.3781, 3.436],
},
{
name: "United States",
coords: [37.0902, -95.7129],
},
],
markerStyle: {
initial: {
strokeWidth: 1,
fill: "#465fff",
fillOpacity: 1,
r: 4,
},
hover: {
fill: "#465fff",
fillOpacity: 1,
},
selected: {},
selectedHover: {},
},
onRegionTooltipShow: function (event, tooltip, code) {
tooltip.text(
tooltip.text() + (code === "EG" ? " <b>(Hello Russia)</b>" : ""),
true // This second parameter enables HTML
);
},
});
}
};
export default initMap;