@apexcura/ui-components 0.0.14-Beta124 → 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 +187 -5
- package/dist/index.mjs +185 -7
- 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,7 +1119,7 @@ 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",
|
|
@@ -1156,7 +1159,7 @@ var import_chart2 = require("chart.js");
|
|
|
1156
1159
|
import_chart2.Chart.register(import_chart2.DoughnutController, import_chart2.ArcElement, import_chart2.Tooltip, import_chart2.Legend);
|
|
1157
1160
|
var SemiCircleDonut = (props) => {
|
|
1158
1161
|
const data = {
|
|
1159
|
-
labels: ["Registration", "Book Appointment", "Diagnostic Tests", "Hospital Facility", "Others Prescriptions"],
|
|
1162
|
+
labels: ["Registration", "Book Appointment", "Diagnostic Tests", "Hospital Facility", "Others, Prescriptions"],
|
|
1160
1163
|
datasets: [
|
|
1161
1164
|
{
|
|
1162
1165
|
label: "Bot Conversation",
|
|
@@ -1180,6 +1183,7 @@ var SemiCircleDonut = (props) => {
|
|
|
1180
1183
|
legend: {
|
|
1181
1184
|
position: "left",
|
|
1182
1185
|
labels: {
|
|
1186
|
+
boxWidth: 15,
|
|
1183
1187
|
generateLabels: (chart) => {
|
|
1184
1188
|
const dataset = chart.data.datasets[0];
|
|
1185
1189
|
return chart.data.labels.map((label, index) => {
|
|
@@ -1213,7 +1217,7 @@ var SemiCircleDonut = (props) => {
|
|
|
1213
1217
|
var import_react33 = __toESM(require("react"));
|
|
1214
1218
|
var import_react_chartjs_23 = require("react-chartjs-2");
|
|
1215
1219
|
var import_chart3 = require("chart.js");
|
|
1216
|
-
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);
|
|
1217
1221
|
var HorizontalBarChart = (props) => {
|
|
1218
1222
|
const data = {
|
|
1219
1223
|
labels: ["18-24", "25-34", "35-44", "45-54", "55-64", "65+"],
|
|
@@ -1226,7 +1230,6 @@ var HorizontalBarChart = (props) => {
|
|
|
1226
1230
|
};
|
|
1227
1231
|
const options = {
|
|
1228
1232
|
responsive: true,
|
|
1229
|
-
indexAxis: "y",
|
|
1230
1233
|
scales: {
|
|
1231
1234
|
x: {
|
|
1232
1235
|
beginAtZero: true,
|
|
@@ -1252,19 +1255,198 @@ var HorizontalBarChart = (props) => {
|
|
|
1252
1255
|
};
|
|
1253
1256
|
return /* @__PURE__ */ import_react33.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react33.default.createElement(import_react_chartjs_23.Bar, { data, options }));
|
|
1254
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
|
+
};
|
|
1255
1434
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1256
1435
|
0 && (module.exports = {
|
|
1257
1436
|
AddMoreTable,
|
|
1437
|
+
BarChart,
|
|
1258
1438
|
ButtonElement,
|
|
1259
1439
|
CheckboxElement,
|
|
1260
1440
|
CircleDonut,
|
|
1261
1441
|
CkEditor,
|
|
1262
1442
|
DatePickerElement,
|
|
1263
1443
|
DateRangePickerElement,
|
|
1444
|
+
DoubleBarChart,
|
|
1264
1445
|
DropDownGroup,
|
|
1265
1446
|
FileUpload,
|
|
1266
1447
|
HorizontalBarChart,
|
|
1267
1448
|
Image,
|
|
1449
|
+
LineChart,
|
|
1268
1450
|
MultipleSelectElement,
|
|
1269
1451
|
Navbar,
|
|
1270
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,7 +1059,7 @@ 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",
|
|
@@ -1105,7 +1105,7 @@ import {
|
|
|
1105
1105
|
ChartJS2.register(DoughnutController2, ArcElement2, Tooltip2, Legend2);
|
|
1106
1106
|
var SemiCircleDonut = (props) => {
|
|
1107
1107
|
const data = {
|
|
1108
|
-
labels: ["Registration", "Book Appointment", "Diagnostic Tests", "Hospital Facility", "Others Prescriptions"],
|
|
1108
|
+
labels: ["Registration", "Book Appointment", "Diagnostic Tests", "Hospital Facility", "Others, Prescriptions"],
|
|
1109
1109
|
datasets: [
|
|
1110
1110
|
{
|
|
1111
1111
|
label: "Bot Conversation",
|
|
@@ -1129,6 +1129,7 @@ var SemiCircleDonut = (props) => {
|
|
|
1129
1129
|
legend: {
|
|
1130
1130
|
position: "left",
|
|
1131
1131
|
labels: {
|
|
1132
|
+
boxWidth: 15,
|
|
1132
1133
|
generateLabels: (chart) => {
|
|
1133
1134
|
const dataset = chart.data.datasets[0];
|
|
1134
1135
|
return chart.data.labels.map((label, index) => {
|
|
@@ -1166,10 +1167,9 @@ import {
|
|
|
1166
1167
|
BarElement,
|
|
1167
1168
|
CategoryScale,
|
|
1168
1169
|
LinearScale,
|
|
1169
|
-
Tooltip as Tooltip3
|
|
1170
|
-
Legend as Legend3
|
|
1170
|
+
Tooltip as Tooltip3
|
|
1171
1171
|
} from "chart.js";
|
|
1172
|
-
ChartJS3.register(BarElement, CategoryScale, LinearScale, Tooltip3
|
|
1172
|
+
ChartJS3.register(BarElement, CategoryScale, LinearScale, Tooltip3);
|
|
1173
1173
|
var HorizontalBarChart = (props) => {
|
|
1174
1174
|
const data = {
|
|
1175
1175
|
labels: ["18-24", "25-34", "35-44", "45-54", "55-64", "65+"],
|
|
@@ -1182,7 +1182,6 @@ var HorizontalBarChart = (props) => {
|
|
|
1182
1182
|
};
|
|
1183
1183
|
const options = {
|
|
1184
1184
|
responsive: true,
|
|
1185
|
-
indexAxis: "y",
|
|
1186
1185
|
scales: {
|
|
1187
1186
|
x: {
|
|
1188
1187
|
beginAtZero: true,
|
|
@@ -1208,18 +1207,197 @@ var HorizontalBarChart = (props) => {
|
|
|
1208
1207
|
};
|
|
1209
1208
|
return /* @__PURE__ */ React33.createElement("div", { className: props.className }, /* @__PURE__ */ React33.createElement(Bar, { data, options }));
|
|
1210
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
|
+
};
|
|
1211
1386
|
export {
|
|
1212
1387
|
AddMoreTable,
|
|
1388
|
+
BarChart,
|
|
1213
1389
|
ButtonElement,
|
|
1214
1390
|
CheckboxElement,
|
|
1215
1391
|
CircleDonut,
|
|
1216
1392
|
CkEditor,
|
|
1217
1393
|
DatePickerElement,
|
|
1218
1394
|
DateRangePickerElement,
|
|
1395
|
+
DoubleBarChart,
|
|
1219
1396
|
DropDownGroup,
|
|
1220
1397
|
FileUpload,
|
|
1221
1398
|
HorizontalBarChart,
|
|
1222
1399
|
Image,
|
|
1400
|
+
LineChart,
|
|
1223
1401
|
MultipleSelectElement,
|
|
1224
1402
|
Navbar,
|
|
1225
1403
|
NumberElement,
|