@apexcura/ui-components 0.0.14-Beta123 → 0.0.14-Beta125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +196 -15
- package/dist/index.mjs +194 -17
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -126,4 +126,10 @@ declare const SemiCircleDonut: (props: ElementType) => React$1.JSX.Element;
|
|
|
126
126
|
|
|
127
127
|
declare const HorizontalBarChart: (props: ElementType) => React$1.JSX.Element;
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
declare const LineChart: React$1.FC;
|
|
130
|
+
|
|
131
|
+
declare const DoubleBarChart: React$1.FC;
|
|
132
|
+
|
|
133
|
+
declare const BarChart: React$1.FC;
|
|
134
|
+
|
|
135
|
+
export { AddMoreTable, BarChart, ButtonElement, CheckboxElement, CircleDonut, CkEditor, DatePickerElement, DateRangePickerElement, DoubleBarChart, DropDownGroup, FileUpload, HorizontalBarChart, Image, LineChart, MultipleSelectElement, Navbar, NumberElement, OtpElement, PasswordElement, RadioElement, SelectElement, SemiCircleDonut, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement, Upload };
|
package/dist/index.d.ts
CHANGED
|
@@ -126,4 +126,10 @@ declare const SemiCircleDonut: (props: ElementType) => React$1.JSX.Element;
|
|
|
126
126
|
|
|
127
127
|
declare const HorizontalBarChart: (props: ElementType) => React$1.JSX.Element;
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
declare const LineChart: React$1.FC;
|
|
130
|
+
|
|
131
|
+
declare const DoubleBarChart: React$1.FC;
|
|
132
|
+
|
|
133
|
+
declare const BarChart: React$1.FC;
|
|
134
|
+
|
|
135
|
+
export { AddMoreTable, BarChart, ButtonElement, CheckboxElement, CircleDonut, CkEditor, DatePickerElement, DateRangePickerElement, DoubleBarChart, DropDownGroup, FileUpload, HorizontalBarChart, Image, LineChart, MultipleSelectElement, Navbar, NumberElement, OtpElement, PasswordElement, RadioElement, SelectElement, SemiCircleDonut, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement, Upload };
|
package/dist/index.js
CHANGED
|
@@ -31,16 +31,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
AddMoreTable: () => AddMoreTable,
|
|
34
|
+
BarChart: () => BarChart,
|
|
34
35
|
ButtonElement: () => ButtonElement,
|
|
35
36
|
CheckboxElement: () => CheckboxElement,
|
|
36
37
|
CircleDonut: () => CircleDonut,
|
|
37
38
|
CkEditor: () => CkEditor,
|
|
38
39
|
DatePickerElement: () => DatePickerElement,
|
|
39
40
|
DateRangePickerElement: () => DateRangePickerElement,
|
|
41
|
+
DoubleBarChart: () => DoubleBarChart,
|
|
40
42
|
DropDownGroup: () => DropDownGroup,
|
|
41
43
|
FileUpload: () => FileUpload,
|
|
42
44
|
HorizontalBarChart: () => HorizontalBarChart,
|
|
43
45
|
Image: () => Image,
|
|
46
|
+
LineChart: () => LineChart,
|
|
44
47
|
MultipleSelectElement: () => MultipleSelectElement,
|
|
45
48
|
Navbar: () => Navbar,
|
|
46
49
|
NumberElement: () => NumberElement,
|
|
@@ -1098,7 +1101,7 @@ var import_chart = require("chart.js");
|
|
|
1098
1101
|
import_chart.Chart.register(import_chart.DoughnutController, import_chart.ArcElement, import_chart.Tooltip, import_chart.Legend);
|
|
1099
1102
|
var CircleDonut = (props) => {
|
|
1100
1103
|
const data = {
|
|
1101
|
-
labels: ["Registration", "Book Appointment", "Diagnostic Tests", "Hospital Facility", "Others Prescriptions"],
|
|
1104
|
+
labels: ["Registration", "Book Appointment", "Diagnostic Tests", "Hospital Facility", "Others, Prescriptions"],
|
|
1102
1105
|
datasets: [
|
|
1103
1106
|
{
|
|
1104
1107
|
label: "Bot Conversation",
|
|
@@ -1116,24 +1119,19 @@ var CircleDonut = (props) => {
|
|
|
1116
1119
|
};
|
|
1117
1120
|
const options = {
|
|
1118
1121
|
responsive: true,
|
|
1119
|
-
rotation: -
|
|
1122
|
+
rotation: -360,
|
|
1120
1123
|
plugins: {
|
|
1121
1124
|
legend: {
|
|
1122
1125
|
position: "left",
|
|
1123
1126
|
labels: {
|
|
1127
|
+
boxWidth: 15,
|
|
1124
1128
|
generateLabels: (chart) => {
|
|
1125
1129
|
const dataset = chart.data.datasets[0];
|
|
1126
1130
|
return chart.data.labels.map((label, index) => {
|
|
1127
1131
|
const value = dataset.data[index];
|
|
1128
1132
|
return {
|
|
1129
1133
|
text: `${label}: ${value}`,
|
|
1130
|
-
fillStyle: dataset.backgroundColor[index]
|
|
1131
|
-
hidden: isNaN(dataset.data[index]) || dataset.data[index] === null,
|
|
1132
|
-
index,
|
|
1133
|
-
boxWidth: 20,
|
|
1134
|
-
// Set the width of the legend box
|
|
1135
|
-
borderColor: "transparent"
|
|
1136
|
-
// Eliminate the border color
|
|
1134
|
+
fillStyle: dataset.backgroundColor[index]
|
|
1137
1135
|
};
|
|
1138
1136
|
});
|
|
1139
1137
|
}
|
|
@@ -1161,7 +1159,7 @@ var import_chart2 = require("chart.js");
|
|
|
1161
1159
|
import_chart2.Chart.register(import_chart2.DoughnutController, import_chart2.ArcElement, import_chart2.Tooltip, import_chart2.Legend);
|
|
1162
1160
|
var SemiCircleDonut = (props) => {
|
|
1163
1161
|
const data = {
|
|
1164
|
-
labels: ["Registration", "Book Appointment", "Diagnostic Tests", "Hospital Facility", "Others Prescriptions"],
|
|
1162
|
+
labels: ["Registration", "Book Appointment", "Diagnostic Tests", "Hospital Facility", "Others, Prescriptions"],
|
|
1165
1163
|
datasets: [
|
|
1166
1164
|
{
|
|
1167
1165
|
label: "Bot Conversation",
|
|
@@ -1185,6 +1183,7 @@ var SemiCircleDonut = (props) => {
|
|
|
1185
1183
|
legend: {
|
|
1186
1184
|
position: "left",
|
|
1187
1185
|
labels: {
|
|
1186
|
+
boxWidth: 15,
|
|
1188
1187
|
generateLabels: (chart) => {
|
|
1189
1188
|
const dataset = chart.data.datasets[0];
|
|
1190
1189
|
return chart.data.labels.map((label, index) => {
|
|
@@ -1218,13 +1217,12 @@ var SemiCircleDonut = (props) => {
|
|
|
1218
1217
|
var import_react33 = __toESM(require("react"));
|
|
1219
1218
|
var import_react_chartjs_23 = require("react-chartjs-2");
|
|
1220
1219
|
var import_chart3 = require("chart.js");
|
|
1221
|
-
import_chart3.Chart.register(import_chart3.BarElement, import_chart3.CategoryScale, import_chart3.LinearScale, import_chart3.Tooltip
|
|
1220
|
+
import_chart3.Chart.register(import_chart3.BarElement, import_chart3.CategoryScale, import_chart3.LinearScale, import_chart3.Tooltip);
|
|
1222
1221
|
var HorizontalBarChart = (props) => {
|
|
1223
1222
|
const data = {
|
|
1224
|
-
labels: ["
|
|
1223
|
+
labels: ["18-24", "25-34", "35-44", "45-54", "55-64", "65+"],
|
|
1225
1224
|
datasets: [
|
|
1226
1225
|
{
|
|
1227
|
-
label: "Bot Conversation",
|
|
1228
1226
|
data: [30, 10, 27, 40, 12, 24],
|
|
1229
1227
|
backgroundColor: "#6298D5"
|
|
1230
1228
|
}
|
|
@@ -1232,10 +1230,14 @@ var HorizontalBarChart = (props) => {
|
|
|
1232
1230
|
};
|
|
1233
1231
|
const options = {
|
|
1234
1232
|
responsive: true,
|
|
1235
|
-
indexAxis: "y",
|
|
1236
1233
|
scales: {
|
|
1237
1234
|
x: {
|
|
1238
|
-
beginAtZero: true
|
|
1235
|
+
beginAtZero: true,
|
|
1236
|
+
ticks: {
|
|
1237
|
+
callback: function(value) {
|
|
1238
|
+
return `${value}%`;
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1239
1241
|
}
|
|
1240
1242
|
},
|
|
1241
1243
|
plugins: {
|
|
@@ -1253,19 +1255,198 @@ var HorizontalBarChart = (props) => {
|
|
|
1253
1255
|
};
|
|
1254
1256
|
return /* @__PURE__ */ import_react33.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react33.default.createElement(import_react_chartjs_23.Bar, { data, options }));
|
|
1255
1257
|
};
|
|
1258
|
+
|
|
1259
|
+
// src/Components/LineChart.tsx
|
|
1260
|
+
var import_react34 = __toESM(require("react"));
|
|
1261
|
+
var import_auto = __toESM(require("chart.js/auto"));
|
|
1262
|
+
var LineChart = () => {
|
|
1263
|
+
const chartRef = (0, import_react34.useRef)(null);
|
|
1264
|
+
const chartInstance = (0, import_react34.useRef)(null);
|
|
1265
|
+
const data = [
|
|
1266
|
+
{ label: "ROI", data: [10, 30, 50, 70, 90] },
|
|
1267
|
+
{ label: "Engagement Rate", data: [20, 40, 60, 80, 100] },
|
|
1268
|
+
{ label: "Conversion Rate", data: [30, 50, 70, 90, 110] }
|
|
1269
|
+
];
|
|
1270
|
+
const labels = ["Instagram", "Whatsapp", "Messages", "Facebook", "Linkedin"];
|
|
1271
|
+
(0, import_react34.useEffect)(() => {
|
|
1272
|
+
if (chartRef.current) {
|
|
1273
|
+
if (chartInstance.current) {
|
|
1274
|
+
chartInstance.current.destroy();
|
|
1275
|
+
}
|
|
1276
|
+
chartInstance.current = new import_auto.default(chartRef.current, {
|
|
1277
|
+
type: "line",
|
|
1278
|
+
data: {
|
|
1279
|
+
labels,
|
|
1280
|
+
datasets: data.map((dataset, index) => ({
|
|
1281
|
+
label: dataset.label,
|
|
1282
|
+
data: dataset.data,
|
|
1283
|
+
borderColor: `rgb(${index * 100}, ${255 - index * 50}, ${index * 50})`,
|
|
1284
|
+
// Example dynamic color generation
|
|
1285
|
+
tension: 0.1,
|
|
1286
|
+
fill: false
|
|
1287
|
+
}))
|
|
1288
|
+
},
|
|
1289
|
+
options: {
|
|
1290
|
+
scales: {
|
|
1291
|
+
y: {
|
|
1292
|
+
beginAtZero: true,
|
|
1293
|
+
suggestedMax: 200,
|
|
1294
|
+
// Adjust based on your data range
|
|
1295
|
+
ticks: {
|
|
1296
|
+
callback: function(value) {
|
|
1297
|
+
return value + "%";
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
});
|
|
1304
|
+
}
|
|
1305
|
+
return () => {
|
|
1306
|
+
if (chartInstance.current) {
|
|
1307
|
+
chartInstance.current.destroy();
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
|
+
}, []);
|
|
1311
|
+
return /* @__PURE__ */ import_react34.default.createElement("canvas", { ref: chartRef });
|
|
1312
|
+
};
|
|
1313
|
+
|
|
1314
|
+
// src/Components/DoubleBarChart.tsx
|
|
1315
|
+
var import_react35 = __toESM(require("react"));
|
|
1316
|
+
var import_auto2 = __toESM(require("chart.js/auto"));
|
|
1317
|
+
var DoubleBarChart = () => {
|
|
1318
|
+
const chartRef = (0, import_react35.useRef)(null);
|
|
1319
|
+
const chartInstance = (0, import_react35.useRef)(null);
|
|
1320
|
+
(0, import_react35.useEffect)(() => {
|
|
1321
|
+
if (chartRef.current) {
|
|
1322
|
+
if (chartInstance.current) {
|
|
1323
|
+
chartInstance.current.destroy();
|
|
1324
|
+
}
|
|
1325
|
+
chartInstance.current = new import_auto2.default(chartRef.current, {
|
|
1326
|
+
type: "bar",
|
|
1327
|
+
data: {
|
|
1328
|
+
labels: [
|
|
1329
|
+
"Summer Health Tips",
|
|
1330
|
+
"New Services Launch",
|
|
1331
|
+
"Discounts on Checkups",
|
|
1332
|
+
"Wellness Webinar",
|
|
1333
|
+
"LinkedIn Insights"
|
|
1334
|
+
],
|
|
1335
|
+
datasets: [
|
|
1336
|
+
{
|
|
1337
|
+
label: "Male",
|
|
1338
|
+
data: [60, 70, 50, 80, 65],
|
|
1339
|
+
// Example data for male
|
|
1340
|
+
backgroundColor: "rgba(54, 162, 235, 0.5)",
|
|
1341
|
+
borderColor: "rgba(54, 162, 235, 1)",
|
|
1342
|
+
borderWidth: 1
|
|
1343
|
+
},
|
|
1344
|
+
{
|
|
1345
|
+
label: "Female",
|
|
1346
|
+
data: [70, 65, 75, 55, 85],
|
|
1347
|
+
// Example data for female
|
|
1348
|
+
backgroundColor: "rgba(255, 99, 132, 0.5)",
|
|
1349
|
+
borderColor: "rgba(255, 99, 132, 1)",
|
|
1350
|
+
borderWidth: 1
|
|
1351
|
+
}
|
|
1352
|
+
]
|
|
1353
|
+
},
|
|
1354
|
+
options: {
|
|
1355
|
+
scales: {
|
|
1356
|
+
y: {
|
|
1357
|
+
beginAtZero: true,
|
|
1358
|
+
suggestedMax: 100,
|
|
1359
|
+
ticks: {
|
|
1360
|
+
callback: function(value) {
|
|
1361
|
+
return value + "%";
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1368
|
+
}
|
|
1369
|
+
return () => {
|
|
1370
|
+
if (chartInstance.current) {
|
|
1371
|
+
chartInstance.current.destroy();
|
|
1372
|
+
}
|
|
1373
|
+
};
|
|
1374
|
+
}, []);
|
|
1375
|
+
return /* @__PURE__ */ import_react35.default.createElement("canvas", { ref: chartRef });
|
|
1376
|
+
};
|
|
1377
|
+
|
|
1378
|
+
// src/Components/BarChart.tsx
|
|
1379
|
+
var import_react36 = __toESM(require("react"));
|
|
1380
|
+
var import_auto3 = __toESM(require("chart.js/auto"));
|
|
1381
|
+
var BarChart = () => {
|
|
1382
|
+
const chartRef = (0, import_react36.useRef)(null);
|
|
1383
|
+
const chartInstance = (0, import_react36.useRef)(null);
|
|
1384
|
+
(0, import_react36.useEffect)(() => {
|
|
1385
|
+
if (chartRef.current) {
|
|
1386
|
+
if (chartInstance.current) {
|
|
1387
|
+
chartInstance.current.destroy();
|
|
1388
|
+
}
|
|
1389
|
+
chartInstance.current = new import_auto3.default(chartRef.current, {
|
|
1390
|
+
type: "bar",
|
|
1391
|
+
data: {
|
|
1392
|
+
labels: [
|
|
1393
|
+
"17 June",
|
|
1394
|
+
"18 June",
|
|
1395
|
+
"19 June",
|
|
1396
|
+
"20 June",
|
|
1397
|
+
"21 June",
|
|
1398
|
+
"22 June",
|
|
1399
|
+
"23 June"
|
|
1400
|
+
],
|
|
1401
|
+
datasets: [
|
|
1402
|
+
{
|
|
1403
|
+
data: [70, 65, 75, 55, 85],
|
|
1404
|
+
// Example data for female
|
|
1405
|
+
backgroundColor: "rgba(255, 99, 132, 0.5)",
|
|
1406
|
+
borderColor: "rgba(255, 99, 132, 1)",
|
|
1407
|
+
borderWidth: 1
|
|
1408
|
+
}
|
|
1409
|
+
]
|
|
1410
|
+
},
|
|
1411
|
+
options: {
|
|
1412
|
+
scales: {
|
|
1413
|
+
y: {
|
|
1414
|
+
beginAtZero: true,
|
|
1415
|
+
suggestedMax: 100,
|
|
1416
|
+
ticks: {
|
|
1417
|
+
callback: function(value) {
|
|
1418
|
+
return value + "%";
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
});
|
|
1425
|
+
}
|
|
1426
|
+
return () => {
|
|
1427
|
+
if (chartInstance.current) {
|
|
1428
|
+
chartInstance.current.destroy();
|
|
1429
|
+
}
|
|
1430
|
+
};
|
|
1431
|
+
}, []);
|
|
1432
|
+
return /* @__PURE__ */ import_react36.default.createElement("canvas", { ref: chartRef });
|
|
1433
|
+
};
|
|
1256
1434
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1257
1435
|
0 && (module.exports = {
|
|
1258
1436
|
AddMoreTable,
|
|
1437
|
+
BarChart,
|
|
1259
1438
|
ButtonElement,
|
|
1260
1439
|
CheckboxElement,
|
|
1261
1440
|
CircleDonut,
|
|
1262
1441
|
CkEditor,
|
|
1263
1442
|
DatePickerElement,
|
|
1264
1443
|
DateRangePickerElement,
|
|
1444
|
+
DoubleBarChart,
|
|
1265
1445
|
DropDownGroup,
|
|
1266
1446
|
FileUpload,
|
|
1267
1447
|
HorizontalBarChart,
|
|
1268
1448
|
Image,
|
|
1449
|
+
LineChart,
|
|
1269
1450
|
MultipleSelectElement,
|
|
1270
1451
|
Navbar,
|
|
1271
1452
|
NumberElement,
|
package/dist/index.mjs
CHANGED
|
@@ -1041,7 +1041,7 @@ import {
|
|
|
1041
1041
|
ChartJS.register(DoughnutController, ArcElement, Tooltip, Legend);
|
|
1042
1042
|
var CircleDonut = (props) => {
|
|
1043
1043
|
const data = {
|
|
1044
|
-
labels: ["Registration", "Book Appointment", "Diagnostic Tests", "Hospital Facility", "Others Prescriptions"],
|
|
1044
|
+
labels: ["Registration", "Book Appointment", "Diagnostic Tests", "Hospital Facility", "Others, Prescriptions"],
|
|
1045
1045
|
datasets: [
|
|
1046
1046
|
{
|
|
1047
1047
|
label: "Bot Conversation",
|
|
@@ -1059,24 +1059,19 @@ var CircleDonut = (props) => {
|
|
|
1059
1059
|
};
|
|
1060
1060
|
const options = {
|
|
1061
1061
|
responsive: true,
|
|
1062
|
-
rotation: -
|
|
1062
|
+
rotation: -360,
|
|
1063
1063
|
plugins: {
|
|
1064
1064
|
legend: {
|
|
1065
1065
|
position: "left",
|
|
1066
1066
|
labels: {
|
|
1067
|
+
boxWidth: 15,
|
|
1067
1068
|
generateLabels: (chart) => {
|
|
1068
1069
|
const dataset = chart.data.datasets[0];
|
|
1069
1070
|
return chart.data.labels.map((label, index) => {
|
|
1070
1071
|
const value = dataset.data[index];
|
|
1071
1072
|
return {
|
|
1072
1073
|
text: `${label}: ${value}`,
|
|
1073
|
-
fillStyle: dataset.backgroundColor[index]
|
|
1074
|
-
hidden: isNaN(dataset.data[index]) || dataset.data[index] === null,
|
|
1075
|
-
index,
|
|
1076
|
-
boxWidth: 20,
|
|
1077
|
-
// Set the width of the legend box
|
|
1078
|
-
borderColor: "transparent"
|
|
1079
|
-
// Eliminate the border color
|
|
1074
|
+
fillStyle: dataset.backgroundColor[index]
|
|
1080
1075
|
};
|
|
1081
1076
|
});
|
|
1082
1077
|
}
|
|
@@ -1110,7 +1105,7 @@ import {
|
|
|
1110
1105
|
ChartJS2.register(DoughnutController2, ArcElement2, Tooltip2, Legend2);
|
|
1111
1106
|
var SemiCircleDonut = (props) => {
|
|
1112
1107
|
const data = {
|
|
1113
|
-
labels: ["Registration", "Book Appointment", "Diagnostic Tests", "Hospital Facility", "Others Prescriptions"],
|
|
1108
|
+
labels: ["Registration", "Book Appointment", "Diagnostic Tests", "Hospital Facility", "Others, Prescriptions"],
|
|
1114
1109
|
datasets: [
|
|
1115
1110
|
{
|
|
1116
1111
|
label: "Bot Conversation",
|
|
@@ -1134,6 +1129,7 @@ var SemiCircleDonut = (props) => {
|
|
|
1134
1129
|
legend: {
|
|
1135
1130
|
position: "left",
|
|
1136
1131
|
labels: {
|
|
1132
|
+
boxWidth: 15,
|
|
1137
1133
|
generateLabels: (chart) => {
|
|
1138
1134
|
const dataset = chart.data.datasets[0];
|
|
1139
1135
|
return chart.data.labels.map((label, index) => {
|
|
@@ -1171,16 +1167,14 @@ import {
|
|
|
1171
1167
|
BarElement,
|
|
1172
1168
|
CategoryScale,
|
|
1173
1169
|
LinearScale,
|
|
1174
|
-
Tooltip as Tooltip3
|
|
1175
|
-
Legend as Legend3
|
|
1170
|
+
Tooltip as Tooltip3
|
|
1176
1171
|
} from "chart.js";
|
|
1177
|
-
ChartJS3.register(BarElement, CategoryScale, LinearScale, Tooltip3
|
|
1172
|
+
ChartJS3.register(BarElement, CategoryScale, LinearScale, Tooltip3);
|
|
1178
1173
|
var HorizontalBarChart = (props) => {
|
|
1179
1174
|
const data = {
|
|
1180
|
-
labels: ["
|
|
1175
|
+
labels: ["18-24", "25-34", "35-44", "45-54", "55-64", "65+"],
|
|
1181
1176
|
datasets: [
|
|
1182
1177
|
{
|
|
1183
|
-
label: "Bot Conversation",
|
|
1184
1178
|
data: [30, 10, 27, 40, 12, 24],
|
|
1185
1179
|
backgroundColor: "#6298D5"
|
|
1186
1180
|
}
|
|
@@ -1188,10 +1182,14 @@ var HorizontalBarChart = (props) => {
|
|
|
1188
1182
|
};
|
|
1189
1183
|
const options = {
|
|
1190
1184
|
responsive: true,
|
|
1191
|
-
indexAxis: "y",
|
|
1192
1185
|
scales: {
|
|
1193
1186
|
x: {
|
|
1194
|
-
beginAtZero: true
|
|
1187
|
+
beginAtZero: true,
|
|
1188
|
+
ticks: {
|
|
1189
|
+
callback: function(value) {
|
|
1190
|
+
return `${value}%`;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1195
1193
|
}
|
|
1196
1194
|
},
|
|
1197
1195
|
plugins: {
|
|
@@ -1209,18 +1207,197 @@ var HorizontalBarChart = (props) => {
|
|
|
1209
1207
|
};
|
|
1210
1208
|
return /* @__PURE__ */ React33.createElement("div", { className: props.className }, /* @__PURE__ */ React33.createElement(Bar, { data, options }));
|
|
1211
1209
|
};
|
|
1210
|
+
|
|
1211
|
+
// src/Components/LineChart.tsx
|
|
1212
|
+
import React34, { useEffect as useEffect4, useRef as useRef2 } from "react";
|
|
1213
|
+
import Chart from "chart.js/auto";
|
|
1214
|
+
var LineChart = () => {
|
|
1215
|
+
const chartRef = useRef2(null);
|
|
1216
|
+
const chartInstance = useRef2(null);
|
|
1217
|
+
const data = [
|
|
1218
|
+
{ label: "ROI", data: [10, 30, 50, 70, 90] },
|
|
1219
|
+
{ label: "Engagement Rate", data: [20, 40, 60, 80, 100] },
|
|
1220
|
+
{ label: "Conversion Rate", data: [30, 50, 70, 90, 110] }
|
|
1221
|
+
];
|
|
1222
|
+
const labels = ["Instagram", "Whatsapp", "Messages", "Facebook", "Linkedin"];
|
|
1223
|
+
useEffect4(() => {
|
|
1224
|
+
if (chartRef.current) {
|
|
1225
|
+
if (chartInstance.current) {
|
|
1226
|
+
chartInstance.current.destroy();
|
|
1227
|
+
}
|
|
1228
|
+
chartInstance.current = new Chart(chartRef.current, {
|
|
1229
|
+
type: "line",
|
|
1230
|
+
data: {
|
|
1231
|
+
labels,
|
|
1232
|
+
datasets: data.map((dataset, index) => ({
|
|
1233
|
+
label: dataset.label,
|
|
1234
|
+
data: dataset.data,
|
|
1235
|
+
borderColor: `rgb(${index * 100}, ${255 - index * 50}, ${index * 50})`,
|
|
1236
|
+
// Example dynamic color generation
|
|
1237
|
+
tension: 0.1,
|
|
1238
|
+
fill: false
|
|
1239
|
+
}))
|
|
1240
|
+
},
|
|
1241
|
+
options: {
|
|
1242
|
+
scales: {
|
|
1243
|
+
y: {
|
|
1244
|
+
beginAtZero: true,
|
|
1245
|
+
suggestedMax: 200,
|
|
1246
|
+
// Adjust based on your data range
|
|
1247
|
+
ticks: {
|
|
1248
|
+
callback: function(value) {
|
|
1249
|
+
return value + "%";
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
return () => {
|
|
1258
|
+
if (chartInstance.current) {
|
|
1259
|
+
chartInstance.current.destroy();
|
|
1260
|
+
}
|
|
1261
|
+
};
|
|
1262
|
+
}, []);
|
|
1263
|
+
return /* @__PURE__ */ React34.createElement("canvas", { ref: chartRef });
|
|
1264
|
+
};
|
|
1265
|
+
|
|
1266
|
+
// src/Components/DoubleBarChart.tsx
|
|
1267
|
+
import React35, { useEffect as useEffect5, useRef as useRef3 } from "react";
|
|
1268
|
+
import Chart2 from "chart.js/auto";
|
|
1269
|
+
var DoubleBarChart = () => {
|
|
1270
|
+
const chartRef = useRef3(null);
|
|
1271
|
+
const chartInstance = useRef3(null);
|
|
1272
|
+
useEffect5(() => {
|
|
1273
|
+
if (chartRef.current) {
|
|
1274
|
+
if (chartInstance.current) {
|
|
1275
|
+
chartInstance.current.destroy();
|
|
1276
|
+
}
|
|
1277
|
+
chartInstance.current = new Chart2(chartRef.current, {
|
|
1278
|
+
type: "bar",
|
|
1279
|
+
data: {
|
|
1280
|
+
labels: [
|
|
1281
|
+
"Summer Health Tips",
|
|
1282
|
+
"New Services Launch",
|
|
1283
|
+
"Discounts on Checkups",
|
|
1284
|
+
"Wellness Webinar",
|
|
1285
|
+
"LinkedIn Insights"
|
|
1286
|
+
],
|
|
1287
|
+
datasets: [
|
|
1288
|
+
{
|
|
1289
|
+
label: "Male",
|
|
1290
|
+
data: [60, 70, 50, 80, 65],
|
|
1291
|
+
// Example data for male
|
|
1292
|
+
backgroundColor: "rgba(54, 162, 235, 0.5)",
|
|
1293
|
+
borderColor: "rgba(54, 162, 235, 1)",
|
|
1294
|
+
borderWidth: 1
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
label: "Female",
|
|
1298
|
+
data: [70, 65, 75, 55, 85],
|
|
1299
|
+
// Example data for female
|
|
1300
|
+
backgroundColor: "rgba(255, 99, 132, 0.5)",
|
|
1301
|
+
borderColor: "rgba(255, 99, 132, 1)",
|
|
1302
|
+
borderWidth: 1
|
|
1303
|
+
}
|
|
1304
|
+
]
|
|
1305
|
+
},
|
|
1306
|
+
options: {
|
|
1307
|
+
scales: {
|
|
1308
|
+
y: {
|
|
1309
|
+
beginAtZero: true,
|
|
1310
|
+
suggestedMax: 100,
|
|
1311
|
+
ticks: {
|
|
1312
|
+
callback: function(value) {
|
|
1313
|
+
return value + "%";
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
return () => {
|
|
1322
|
+
if (chartInstance.current) {
|
|
1323
|
+
chartInstance.current.destroy();
|
|
1324
|
+
}
|
|
1325
|
+
};
|
|
1326
|
+
}, []);
|
|
1327
|
+
return /* @__PURE__ */ React35.createElement("canvas", { ref: chartRef });
|
|
1328
|
+
};
|
|
1329
|
+
|
|
1330
|
+
// src/Components/BarChart.tsx
|
|
1331
|
+
import React36, { useEffect as useEffect6, useRef as useRef4 } from "react";
|
|
1332
|
+
import Chart3 from "chart.js/auto";
|
|
1333
|
+
var BarChart = () => {
|
|
1334
|
+
const chartRef = useRef4(null);
|
|
1335
|
+
const chartInstance = useRef4(null);
|
|
1336
|
+
useEffect6(() => {
|
|
1337
|
+
if (chartRef.current) {
|
|
1338
|
+
if (chartInstance.current) {
|
|
1339
|
+
chartInstance.current.destroy();
|
|
1340
|
+
}
|
|
1341
|
+
chartInstance.current = new Chart3(chartRef.current, {
|
|
1342
|
+
type: "bar",
|
|
1343
|
+
data: {
|
|
1344
|
+
labels: [
|
|
1345
|
+
"17 June",
|
|
1346
|
+
"18 June",
|
|
1347
|
+
"19 June",
|
|
1348
|
+
"20 June",
|
|
1349
|
+
"21 June",
|
|
1350
|
+
"22 June",
|
|
1351
|
+
"23 June"
|
|
1352
|
+
],
|
|
1353
|
+
datasets: [
|
|
1354
|
+
{
|
|
1355
|
+
data: [70, 65, 75, 55, 85],
|
|
1356
|
+
// Example data for female
|
|
1357
|
+
backgroundColor: "rgba(255, 99, 132, 0.5)",
|
|
1358
|
+
borderColor: "rgba(255, 99, 132, 1)",
|
|
1359
|
+
borderWidth: 1
|
|
1360
|
+
}
|
|
1361
|
+
]
|
|
1362
|
+
},
|
|
1363
|
+
options: {
|
|
1364
|
+
scales: {
|
|
1365
|
+
y: {
|
|
1366
|
+
beginAtZero: true,
|
|
1367
|
+
suggestedMax: 100,
|
|
1368
|
+
ticks: {
|
|
1369
|
+
callback: function(value) {
|
|
1370
|
+
return value + "%";
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
});
|
|
1377
|
+
}
|
|
1378
|
+
return () => {
|
|
1379
|
+
if (chartInstance.current) {
|
|
1380
|
+
chartInstance.current.destroy();
|
|
1381
|
+
}
|
|
1382
|
+
};
|
|
1383
|
+
}, []);
|
|
1384
|
+
return /* @__PURE__ */ React36.createElement("canvas", { ref: chartRef });
|
|
1385
|
+
};
|
|
1212
1386
|
export {
|
|
1213
1387
|
AddMoreTable,
|
|
1388
|
+
BarChart,
|
|
1214
1389
|
ButtonElement,
|
|
1215
1390
|
CheckboxElement,
|
|
1216
1391
|
CircleDonut,
|
|
1217
1392
|
CkEditor,
|
|
1218
1393
|
DatePickerElement,
|
|
1219
1394
|
DateRangePickerElement,
|
|
1395
|
+
DoubleBarChart,
|
|
1220
1396
|
DropDownGroup,
|
|
1221
1397
|
FileUpload,
|
|
1222
1398
|
HorizontalBarChart,
|
|
1223
1399
|
Image,
|
|
1400
|
+
LineChart,
|
|
1224
1401
|
MultipleSelectElement,
|
|
1225
1402
|
Navbar,
|
|
1226
1403
|
NumberElement,
|