@tekkare/auriga 0.1.4 → 0.1.6
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/module.json +1 -1
- package/dist/runtime/components/argAdvancedSearchBar.vue +2 -1
- package/dist/runtime/components/argChart.vue +691 -0
- package/dist/runtime/components/argChart.vue.d.ts +119 -0
- package/dist/runtime/components/argCheckbox.vue +153 -0
- package/dist/runtime/components/argCheckbox.vue.d.ts +58 -0
- package/dist/runtime/components/argComplexSelect.vue +141 -40
- package/dist/runtime/components/argComplexSelect.vue.d.ts +55 -0
- package/dist/runtime/components/argDropdownSelect.vue +36 -29
- package/dist/runtime/components/argDropdownSelect.vue.d.ts +21 -11
- package/dist/runtime/components/argFilterCard.vue +130 -0
- package/dist/runtime/components/argFilterCard.vue.d.ts +19 -0
- package/dist/runtime/components/argFlag.vue +277 -0
- package/dist/runtime/components/argFlag.vue.d.ts +258 -0
- package/dist/runtime/components/argFooter.vue +41 -0
- package/dist/runtime/components/argFooter.vue.d.ts +2 -0
- package/dist/runtime/components/argHeader.vue +96 -0
- package/dist/runtime/components/argHeader.vue.d.ts +44 -0
- package/dist/runtime/components/argHeaderTabs.vue +7 -3
- package/dist/runtime/components/argInfoBar.vue +0 -0
- package/dist/runtime/components/argLineBreak.vue +21 -0
- package/dist/runtime/components/argLineBreak.vue.d.ts +2 -0
- package/dist/runtime/components/argMainLayout.vue +56 -0
- package/dist/runtime/components/argMainLayout.vue.d.ts +2 -0
- package/dist/runtime/components/argMenuItem.vue +73 -0
- package/dist/runtime/components/argMenuItem.vue.d.ts +36 -0
- package/dist/runtime/components/argMenuLink.vue +39 -0
- package/dist/runtime/components/argMenuLink.vue.d.ts +32 -0
- package/dist/runtime/components/argNavBar.vue +320 -0
- package/dist/runtime/components/argNavBar.vue.d.ts +35 -0
- package/dist/runtime/components/argNote.vue +87 -0
- package/dist/runtime/components/argNote.vue.d.ts +42 -0
- package/dist/runtime/components/argSidebar.vue +110 -0
- package/dist/runtime/components/argSidebar.vue.d.ts +33 -0
- package/dist/runtime/components/argSimpleLabel.vue +56 -13
- package/dist/runtime/components/argSimpleLabel.vue.d.ts +18 -0
- package/dist/runtime/components/argStyle.vue +10 -0
- package/dist/runtime/components/argSubMenu.vue +67 -0
- package/dist/runtime/components/argSubMenu.vue.d.ts +30 -0
- package/dist/runtime/components/argSwitch.vue +158 -0
- package/dist/runtime/components/argSwitch.vue.d.ts +45 -0
- package/dist/runtime/components/argTable.vue +201 -141
- package/dist/runtime/components/argTable.vue.d.ts +22 -3
- package/dist/runtime/components/argTooltip.vue +1 -1
- package/package.json +6 -3
package/dist/module.json
CHANGED
|
@@ -405,9 +405,10 @@ export default defineComponent({
|
|
|
405
405
|
removeSelected.value = false;
|
|
406
406
|
closeIndex.value = null;
|
|
407
407
|
searchBar.value.focus();
|
|
408
|
+
emit("update:Value", searchedWords.value);
|
|
408
409
|
}
|
|
409
410
|
function selectSearch(item) {
|
|
410
|
-
|
|
411
|
+
const searchValue = value.value.replace(regexSearch, "");
|
|
411
412
|
selectedShortcut.value = item.symbol;
|
|
412
413
|
if (searchValue.length > 0) {
|
|
413
414
|
if (searchedWords.value.filter((f) => f.value === searchValue).length === 0) {
|
|
@@ -0,0 +1,691 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="prmt_chart">
|
|
3
|
+
<h1 class="prmt_chart_title"><slot name="title" /></h1>
|
|
4
|
+
<div class="prmt_chart_source"><slot name="source" /></div>
|
|
5
|
+
<client-only>
|
|
6
|
+
<apexchart
|
|
7
|
+
:type="chartType"
|
|
8
|
+
:options="chartOptions"
|
|
9
|
+
:series="series"
|
|
10
|
+
:height="height"
|
|
11
|
+
:width="width"
|
|
12
|
+
:key="chartKey"
|
|
13
|
+
/>
|
|
14
|
+
</client-only>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
<script>
|
|
18
|
+
import {
|
|
19
|
+
onMounted,
|
|
20
|
+
ref,
|
|
21
|
+
computed,
|
|
22
|
+
watch,
|
|
23
|
+
defineProps,
|
|
24
|
+
defineEmits,
|
|
25
|
+
defineComponent,
|
|
26
|
+
defineAsyncComponent,
|
|
27
|
+
} from "vue";
|
|
28
|
+
|
|
29
|
+
const ApexCharts = defineAsyncComponent(() => import("vue3-apexcharts"));
|
|
30
|
+
export default defineComponent({
|
|
31
|
+
name: "argChart",
|
|
32
|
+
components: { apexchart: ApexCharts },
|
|
33
|
+
props: {
|
|
34
|
+
options: {
|
|
35
|
+
type: Object,
|
|
36
|
+
required: false,
|
|
37
|
+
default() {
|
|
38
|
+
return {};
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
series: {
|
|
42
|
+
type: Array,
|
|
43
|
+
required: true,
|
|
44
|
+
},
|
|
45
|
+
type: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: true,
|
|
48
|
+
},
|
|
49
|
+
height: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "auto",
|
|
52
|
+
},
|
|
53
|
+
width: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "100%",
|
|
56
|
+
},
|
|
57
|
+
categories: {
|
|
58
|
+
type: Array,
|
|
59
|
+
required: true,
|
|
60
|
+
},
|
|
61
|
+
colors: {
|
|
62
|
+
type: Array,
|
|
63
|
+
required: false,
|
|
64
|
+
default: () => [
|
|
65
|
+
"#3b82f6",
|
|
66
|
+
"#10b981",
|
|
67
|
+
"#f59e0b",
|
|
68
|
+
"#f43f5e",
|
|
69
|
+
"#8b5cf6",
|
|
70
|
+
"#ec4899",
|
|
71
|
+
"#f97316",
|
|
72
|
+
"#14b8a6",
|
|
73
|
+
"#6366f1",
|
|
74
|
+
"#eab308",
|
|
75
|
+
"#a855f7",
|
|
76
|
+
"#22c55e",
|
|
77
|
+
"#0ea5e9",
|
|
78
|
+
"#84cc16",
|
|
79
|
+
"#d946ef",
|
|
80
|
+
"#06b6d4",
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
withPercentages: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false,
|
|
86
|
+
},
|
|
87
|
+
compactValues: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: false,
|
|
90
|
+
},
|
|
91
|
+
french: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: false,
|
|
94
|
+
},
|
|
95
|
+
hideLegend: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
default: false,
|
|
98
|
+
},
|
|
99
|
+
tooltipOptions: {
|
|
100
|
+
type: Object,
|
|
101
|
+
default: undefined,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
setup(props) {
|
|
105
|
+
const chartKey = ref(1);
|
|
106
|
+
const chartOptions = computed(() => {
|
|
107
|
+
const seriesData = props.series;
|
|
108
|
+
const hasPercentages = props.withPercentages;
|
|
109
|
+
const compactMode = props.compactValues;
|
|
110
|
+
const hideLegend = props.hideLegend;
|
|
111
|
+
|
|
112
|
+
//General styling
|
|
113
|
+
props.options["grid"] = {
|
|
114
|
+
borderColor: "#EAEAF5",
|
|
115
|
+
strokeDashArray: 7,
|
|
116
|
+
padding: { left: 30, right: 30 },
|
|
117
|
+
row: { colors: ["transparent"], opacity: 0 },
|
|
118
|
+
};
|
|
119
|
+
props.options["chart"] = {
|
|
120
|
+
animations: { enabled: false },
|
|
121
|
+
redrawOnParentResize: true,
|
|
122
|
+
redrawOnWindowResize: true,
|
|
123
|
+
};
|
|
124
|
+
props.options["title"] = { align: "center" };
|
|
125
|
+
|
|
126
|
+
//Change to French
|
|
127
|
+
//if(this.french){
|
|
128
|
+
// this.options.chart['locales'] = [fr]
|
|
129
|
+
// this.options.chart['defaultLocale'] = 'fr'
|
|
130
|
+
//}
|
|
131
|
+
|
|
132
|
+
//Override colors
|
|
133
|
+
|
|
134
|
+
if (props.colors) {
|
|
135
|
+
props.options["colors"] = props.colors;
|
|
136
|
+
}
|
|
137
|
+
//Adjustments specific to line charts
|
|
138
|
+
if (props.type === "line") {
|
|
139
|
+
props.options["stroke"] = { width: 3, curve: "smooth" };
|
|
140
|
+
let defaultDataLabelsConfig = {
|
|
141
|
+
enabled: true,
|
|
142
|
+
position: "top",
|
|
143
|
+
style: {
|
|
144
|
+
fontFamily: "Figtree, sans-serif",
|
|
145
|
+
fontSize: "12px",
|
|
146
|
+
fontWeight: "400",
|
|
147
|
+
},
|
|
148
|
+
background: {
|
|
149
|
+
borderColor: "transparent",
|
|
150
|
+
opacity: 1,
|
|
151
|
+
borderRadius: 2,
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
if (props.options.dataLabels && props.options.dataLabels.formatter) {
|
|
155
|
+
props.options["dataLabels"] = {
|
|
156
|
+
...defaultDataLabelsConfig,
|
|
157
|
+
...props.options.dataLabels,
|
|
158
|
+
};
|
|
159
|
+
} else {
|
|
160
|
+
let defaultDataLabelFormatter = {
|
|
161
|
+
formatter(value, opt) {
|
|
162
|
+
let returnValue = value;
|
|
163
|
+
if (compactMode) {
|
|
164
|
+
returnValue = new Intl.NumberFormat("en-US", {
|
|
165
|
+
notation: "compact",
|
|
166
|
+
maximumFractionDigits: 1,
|
|
167
|
+
}).format(value);
|
|
168
|
+
}
|
|
169
|
+
if (!compactMode) {
|
|
170
|
+
returnValue = new Intl.NumberFormat("fr-FR")
|
|
171
|
+
.format(value)
|
|
172
|
+
.replace(",", ".");
|
|
173
|
+
}
|
|
174
|
+
//Make sure data is not null and don't show percentage if null
|
|
175
|
+
if (hasPercentages) {
|
|
176
|
+
let seriesLength = seriesData.length;
|
|
177
|
+
if (
|
|
178
|
+
opt.dataPointIndex > 0 &&
|
|
179
|
+
seriesData[opt.seriesIndex].data[opt.dataPointIndex - 1] !==
|
|
180
|
+
null &&
|
|
181
|
+
seriesData[opt.seriesIndex].data[opt.dataPointIndex] !== null
|
|
182
|
+
) {
|
|
183
|
+
let previousVal =
|
|
184
|
+
seriesData[opt.seriesIndex].data[opt.dataPointIndex - 1];
|
|
185
|
+
let percentageValue = new Intl.NumberFormat("fr-FR")
|
|
186
|
+
.format(
|
|
187
|
+
(((value - previousVal) / previousVal) * 100.0).toFixed(1)
|
|
188
|
+
)
|
|
189
|
+
.replace(",", ".");
|
|
190
|
+
if (percentageValue > 0) {
|
|
191
|
+
returnValue = returnValue + " (+" + percentageValue + "%)";
|
|
192
|
+
} else {
|
|
193
|
+
returnValue = returnValue + " (" + percentageValue + "%)";
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (
|
|
198
|
+
seriesData[opt.seriesIndex].data[opt.dataPointIndex] !== null
|
|
199
|
+
) {
|
|
200
|
+
return returnValue;
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
props.options["dataLabels"] = {
|
|
205
|
+
...defaultDataLabelsConfig,
|
|
206
|
+
...defaultDataLabelFormatter,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
props.options["legend"] = {
|
|
211
|
+
showForSingleSeries: true,
|
|
212
|
+
showForNullSeries: true,
|
|
213
|
+
showForZeroSeries: true,
|
|
214
|
+
show: true,
|
|
215
|
+
position: "bottom",
|
|
216
|
+
fontFamily: "Figtree, sans-serif",
|
|
217
|
+
fontSize: "14px",
|
|
218
|
+
markers: {
|
|
219
|
+
width: 10,
|
|
220
|
+
height: 10,
|
|
221
|
+
radius: 1,
|
|
222
|
+
showNullDataPoints: true,
|
|
223
|
+
},
|
|
224
|
+
itemMargin: { vertical: 8, horizontal: 8 },
|
|
225
|
+
};
|
|
226
|
+
props.options["xaxis"] = {
|
|
227
|
+
categories: props.categories,
|
|
228
|
+
axisBorder: { show: false },
|
|
229
|
+
axisTicks: { show: false },
|
|
230
|
+
labels: {
|
|
231
|
+
show: true,
|
|
232
|
+
style: {
|
|
233
|
+
fontFamily: "Figtree, sans-serif",
|
|
234
|
+
fontSize: "12px",
|
|
235
|
+
fontWeight: "400",
|
|
236
|
+
colors: ["#3E3F5E"],
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
props.options["yaxis"] = { min: 0, show: false };
|
|
241
|
+
props.options["markers"] = { size: 0, showNullDataPoints: true };
|
|
242
|
+
if (props.tooltipOptions) {
|
|
243
|
+
props.options["tooltip"] = props.tooltipOptions;
|
|
244
|
+
} else
|
|
245
|
+
props.options["tooltip"] = {
|
|
246
|
+
y: {
|
|
247
|
+
formatter(value, { series, seriesIndex, dataPointIndex, w }) {
|
|
248
|
+
return value;
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
//Column bar charts
|
|
254
|
+
else if (props.type === "bar-column" || props.type === "bar") {
|
|
255
|
+
let predefinedColors = false;
|
|
256
|
+
if (props.colors) {
|
|
257
|
+
predefinedColors = true;
|
|
258
|
+
}
|
|
259
|
+
props.options["plotOptions"] = {
|
|
260
|
+
bar: {
|
|
261
|
+
distributed: predefinedColors,
|
|
262
|
+
columnWidth: "50%",
|
|
263
|
+
colors: { backgroundBarOpacity: 1 },
|
|
264
|
+
dataLabels: { position: "top", hideOverflowingLabels: true },
|
|
265
|
+
},
|
|
266
|
+
};
|
|
267
|
+
props.options["dataLabels"] = {
|
|
268
|
+
position: "top",
|
|
269
|
+
enabled: true,
|
|
270
|
+
offsetY: -20,
|
|
271
|
+
style: { fontSize: "14px", colors: ["#3E3F5E"], fontWeight: "500" },
|
|
272
|
+
formatter(value, opt) {
|
|
273
|
+
let returnValue = value;
|
|
274
|
+
if (compactMode) {
|
|
275
|
+
returnValue = new Intl.NumberFormat("en-US", {
|
|
276
|
+
notation: "compact",
|
|
277
|
+
maximumFractionDigits: 1,
|
|
278
|
+
}).format(value);
|
|
279
|
+
}
|
|
280
|
+
if (!compactMode) {
|
|
281
|
+
returnValue = new Intl.NumberFormat("fr-FR").format(value);
|
|
282
|
+
}
|
|
283
|
+
if (hasPercentages) {
|
|
284
|
+
let seriesTotal = seriesData[opt.seriesIndex].data.reduce(
|
|
285
|
+
(a, b) => a + b,
|
|
286
|
+
0
|
|
287
|
+
);
|
|
288
|
+
let percentage = new Intl.NumberFormat("fr-FR")
|
|
289
|
+
.format(((100 * value) / seriesTotal).toFixed(1))
|
|
290
|
+
.replace(",", ".");
|
|
291
|
+
returnValue = returnValue + " (" + percentage + "%)";
|
|
292
|
+
}
|
|
293
|
+
return returnValue;
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
if (props.hideLegend) {
|
|
297
|
+
props.options["legend"] = { show: false };
|
|
298
|
+
}
|
|
299
|
+
if (props.tooltipOptions) {
|
|
300
|
+
props.options["tooltip"] = props.tooltipOptions;
|
|
301
|
+
}
|
|
302
|
+
props.options["xaxis"] = {
|
|
303
|
+
categories: props.categories,
|
|
304
|
+
axisBorder: { show: false },
|
|
305
|
+
axisTicks: { show: false },
|
|
306
|
+
labels: {
|
|
307
|
+
show: true,
|
|
308
|
+
style: {
|
|
309
|
+
fontFamily: "Figtree, sans-serif",
|
|
310
|
+
fontSize: "14px",
|
|
311
|
+
fontWeight: "400",
|
|
312
|
+
colors: ["#3E3F5E"],
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
};
|
|
316
|
+
props.options["yaxis"] = { show: false, min: 0 };
|
|
317
|
+
}
|
|
318
|
+
//Horizontal bar chart
|
|
319
|
+
else if (props.type === "bar-horizontal") {
|
|
320
|
+
let predefinedColors = false;
|
|
321
|
+
if (props.colors) {
|
|
322
|
+
predefinedColors = true;
|
|
323
|
+
}
|
|
324
|
+
props.options["plotOptions"] = {
|
|
325
|
+
bar: {
|
|
326
|
+
distributed: predefinedColors,
|
|
327
|
+
horizontal: true,
|
|
328
|
+
borderRadius: 2,
|
|
329
|
+
barHeight: "50%",
|
|
330
|
+
colors: { backgroundBarOpacity: 1 },
|
|
331
|
+
dataLabels: { position: "top", hideOverflowingLabels: true },
|
|
332
|
+
},
|
|
333
|
+
};
|
|
334
|
+
props.options["dataLabels"] = {
|
|
335
|
+
position: "top",
|
|
336
|
+
enabled: true,
|
|
337
|
+
offsetX: 65,
|
|
338
|
+
style: { fontSize: "14px", colors: ["#3E3F5E"] },
|
|
339
|
+
formatter(value, opt) {
|
|
340
|
+
let returnValue = value;
|
|
341
|
+
if (compactMode) {
|
|
342
|
+
returnValue = new Intl.NumberFormat("en-US", {
|
|
343
|
+
notation: "compact",
|
|
344
|
+
maximumFractionDigits: 1,
|
|
345
|
+
}).format(value);
|
|
346
|
+
}
|
|
347
|
+
if (!compactMode) {
|
|
348
|
+
returnValue = new Intl.NumberFormat("fr-FR").format(value);
|
|
349
|
+
}
|
|
350
|
+
if (hasPercentages) {
|
|
351
|
+
let seriesTotal = seriesData[opt.seriesIndex].data.reduce(
|
|
352
|
+
(a, b) => a + b,
|
|
353
|
+
0
|
|
354
|
+
);
|
|
355
|
+
let percentage = new Intl.NumberFormat("fr-FR")
|
|
356
|
+
.format(((100 * value) / seriesTotal).toFixed(1))
|
|
357
|
+
.replace(",", ".");
|
|
358
|
+
returnValue = returnValue + " (" + percentage + "%)";
|
|
359
|
+
}
|
|
360
|
+
return returnValue;
|
|
361
|
+
},
|
|
362
|
+
};
|
|
363
|
+
if (props.hideLegend) {
|
|
364
|
+
props.options["legend"] = { show: false };
|
|
365
|
+
}
|
|
366
|
+
if (props.tooltipOptions) {
|
|
367
|
+
props.options["tooltip"] = props.tooltipOptions;
|
|
368
|
+
}
|
|
369
|
+
props.options["xaxis"] = {
|
|
370
|
+
categories: props.categories,
|
|
371
|
+
axisBorder: { show: false },
|
|
372
|
+
axisTicks: { show: false },
|
|
373
|
+
labels: {
|
|
374
|
+
show: false,
|
|
375
|
+
style: {
|
|
376
|
+
fontFamily: "Figtree, sans-serif",
|
|
377
|
+
fontSize: "14px",
|
|
378
|
+
fontWeight: "400",
|
|
379
|
+
colors: ["#3E3F5E"],
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
// Horizontal Stacks
|
|
385
|
+
else if (props.type === "bar-horizontal-stack") {
|
|
386
|
+
props.options["plotOptions"] = {
|
|
387
|
+
bar: {
|
|
388
|
+
horizontal: true,
|
|
389
|
+
borderRadius: 2,
|
|
390
|
+
barHeight: "50%",
|
|
391
|
+
colors: { backgroundBarOpacity: 1 },
|
|
392
|
+
dataLabels: { position: "top", hideOverflowingLabels: true },
|
|
393
|
+
},
|
|
394
|
+
};
|
|
395
|
+
props.options["dataLabels"] = {
|
|
396
|
+
position: "top",
|
|
397
|
+
enabled: true,
|
|
398
|
+
offsetX: -30,
|
|
399
|
+
style: { fontSize: "14px", colors: ["#FFFFFF"] },
|
|
400
|
+
formatter(value, opt) {
|
|
401
|
+
let returnValue = value;
|
|
402
|
+
if (compactMode) {
|
|
403
|
+
returnValue = new Intl.NumberFormat("en-US", {
|
|
404
|
+
notation: "compact",
|
|
405
|
+
maximumFractionDigits: 1,
|
|
406
|
+
}).format(value);
|
|
407
|
+
}
|
|
408
|
+
if (!compactMode) {
|
|
409
|
+
returnValue = new Intl.NumberFormat("fr-FR").format(value);
|
|
410
|
+
}
|
|
411
|
+
if (hasPercentages) {
|
|
412
|
+
let groupTotal = 0;
|
|
413
|
+
seriesData.map(
|
|
414
|
+
(d) => (groupTotal = groupTotal + d.data[opt.dataPointIndex])
|
|
415
|
+
);
|
|
416
|
+
let percentage = new Intl.NumberFormat("fr-FR")
|
|
417
|
+
.format(((100 * value) / groupTotal).toFixed(1))
|
|
418
|
+
.replace(",", ".");
|
|
419
|
+
returnValue = returnValue + " (" + percentage + "%)";
|
|
420
|
+
}
|
|
421
|
+
return returnValue;
|
|
422
|
+
},
|
|
423
|
+
};
|
|
424
|
+
if (props.tooltipOptions) {
|
|
425
|
+
props.options["tooltip"] = props.tooltipOptions;
|
|
426
|
+
}
|
|
427
|
+
props.options.chart["stacked"] = true;
|
|
428
|
+
props.options["xaxis"] = {
|
|
429
|
+
categories: props.categories,
|
|
430
|
+
axisBorder: { show: false },
|
|
431
|
+
axisTicks: { show: false },
|
|
432
|
+
labels: {
|
|
433
|
+
show: false,
|
|
434
|
+
style: {
|
|
435
|
+
fontFamily: "Figtree, sans-serif",
|
|
436
|
+
fontSize: "14px",
|
|
437
|
+
fontWeight: "400",
|
|
438
|
+
colors: ["#3E3F5E"],
|
|
439
|
+
},
|
|
440
|
+
},
|
|
441
|
+
};
|
|
442
|
+
} else if (props.type === "full-bar-horizontal-stack") {
|
|
443
|
+
props.options["plotOptions"] = {
|
|
444
|
+
bar: {
|
|
445
|
+
horizontal: true,
|
|
446
|
+
borderRadius: 2,
|
|
447
|
+
barHeight: "50%",
|
|
448
|
+
colors: { backgroundBarOpacity: 1 },
|
|
449
|
+
dataLabels: { position: "top", hideOverflowingLabels: true },
|
|
450
|
+
},
|
|
451
|
+
};
|
|
452
|
+
props.options.chart["stacked"] = true;
|
|
453
|
+
props.options.chart["stackType"] = "100%";
|
|
454
|
+
props.options["xaxis"] = {
|
|
455
|
+
categories: props.categories,
|
|
456
|
+
axisBorder: { show: false },
|
|
457
|
+
axisTicks: { show: false },
|
|
458
|
+
labels: {
|
|
459
|
+
show: false,
|
|
460
|
+
style: {
|
|
461
|
+
fontFamily: "Figtree, sans-serif",
|
|
462
|
+
fontSize: "14px",
|
|
463
|
+
fontWeight: "400",
|
|
464
|
+
colors: ["#3E3F5E"],
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
};
|
|
468
|
+
props.options["dataLabels"] = {
|
|
469
|
+
position: "top",
|
|
470
|
+
enabled: true,
|
|
471
|
+
offsetX: -50,
|
|
472
|
+
style: { fontSize: "14px", colors: ["#3E3F5E"] },
|
|
473
|
+
formatter(value, opt) {
|
|
474
|
+
let dataValue =
|
|
475
|
+
seriesData[opt.seriesIndex].data[opt.dataPointIndex];
|
|
476
|
+
let returnValue = dataValue;
|
|
477
|
+
if (compactMode) {
|
|
478
|
+
returnValue = new Intl.NumberFormat("en-US", {
|
|
479
|
+
notation: "compact",
|
|
480
|
+
maximumFractionDigits: 1,
|
|
481
|
+
}).format(dataValue);
|
|
482
|
+
}
|
|
483
|
+
if (!compactMode) {
|
|
484
|
+
returnValue = new Intl.NumberFormat("fr-FR").format(dataValue);
|
|
485
|
+
}
|
|
486
|
+
if (hasPercentages) {
|
|
487
|
+
returnValue = returnValue + " (" + value.toFixed(1) + "%)";
|
|
488
|
+
}
|
|
489
|
+
return returnValue;
|
|
490
|
+
},
|
|
491
|
+
};
|
|
492
|
+
if (props.tooltipOptions) {
|
|
493
|
+
props.options["tooltip"] = props.tooltipOptions;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
// Horizontal group
|
|
497
|
+
else if (props.type === "bar-horizontal-group") {
|
|
498
|
+
let predefinedColors = false;
|
|
499
|
+
if (props.colors) {
|
|
500
|
+
predefinedColors = true;
|
|
501
|
+
}
|
|
502
|
+
props.options["plotOptions"] = {
|
|
503
|
+
bar: {
|
|
504
|
+
horizontal: true,
|
|
505
|
+
borderRadius: 2,
|
|
506
|
+
barHeight: "50%",
|
|
507
|
+
colors: { backgroundBarOpacity: 1 },
|
|
508
|
+
dataLabels: { position: "top", hideOverflowingLabels: true },
|
|
509
|
+
},
|
|
510
|
+
};
|
|
511
|
+
props.options["dataLabels"] = {
|
|
512
|
+
position: "top",
|
|
513
|
+
enabled: true,
|
|
514
|
+
offsetX: 65,
|
|
515
|
+
style: { fontSize: "14px", colors: ["#3E3F5E"] },
|
|
516
|
+
formatter(value, opt) {
|
|
517
|
+
let returnValue = value;
|
|
518
|
+
if (compactMode) {
|
|
519
|
+
returnValue = new Intl.NumberFormat("en-US", {
|
|
520
|
+
notation: "compact",
|
|
521
|
+
maximumFractionDigits: 1,
|
|
522
|
+
}).format(value);
|
|
523
|
+
}
|
|
524
|
+
if (!compactMode) {
|
|
525
|
+
returnValue = new Intl.NumberFormat("fr-FR").format(value);
|
|
526
|
+
}
|
|
527
|
+
if (hasPercentages) {
|
|
528
|
+
let seriesTotal = seriesData[opt.seriesIndex].data.reduce(
|
|
529
|
+
(a, b) => a + b,
|
|
530
|
+
0
|
|
531
|
+
);
|
|
532
|
+
let percentage = new Intl.NumberFormat("fr-FR")
|
|
533
|
+
.format(((100 * value) / seriesTotal).toFixed(1))
|
|
534
|
+
.replace(",", ".");
|
|
535
|
+
returnValue = returnValue + " (" + percentage + "%)";
|
|
536
|
+
}
|
|
537
|
+
return returnValue;
|
|
538
|
+
},
|
|
539
|
+
};
|
|
540
|
+
if (props.tooltipOptions) {
|
|
541
|
+
props.options["tooltip"] = props.tooltipOptions;
|
|
542
|
+
}
|
|
543
|
+
props.options["xaxis"] = {
|
|
544
|
+
categories: props.categories,
|
|
545
|
+
axisBorder: { show: false },
|
|
546
|
+
axisTicks: { show: false },
|
|
547
|
+
labels: {
|
|
548
|
+
show: false,
|
|
549
|
+
style: {
|
|
550
|
+
fontFamily: "Figtree, sans-serif",
|
|
551
|
+
fontSize: "14px",
|
|
552
|
+
fontWeight: "400",
|
|
553
|
+
colors: ["#3E3F5E"],
|
|
554
|
+
},
|
|
555
|
+
},
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
//Pie/Camambert
|
|
559
|
+
else if (props.type === "pie") {
|
|
560
|
+
props.options["labels"] = props.categories;
|
|
561
|
+
props.options["dataLabels"] = {
|
|
562
|
+
offset: -50,
|
|
563
|
+
enabled: true,
|
|
564
|
+
style: { fontSize: "14px", colors: ["#FFFFFF"] },
|
|
565
|
+
dropShadow: { enabled: false },
|
|
566
|
+
formatter(value, opt) {
|
|
567
|
+
let returnValue = opt.w.config.series[opt.seriesIndex];
|
|
568
|
+
if (compactMode) {
|
|
569
|
+
returnValue = new Intl.NumberFormat("en-US", {
|
|
570
|
+
notation: "compact",
|
|
571
|
+
maximumFractionDigits: 1,
|
|
572
|
+
}).format(opt.w.config.series[opt.seriesIndex]);
|
|
573
|
+
}
|
|
574
|
+
if (!compactMode) {
|
|
575
|
+
returnValue = new Intl.NumberFormat("fr-FR")
|
|
576
|
+
.format(opt.w.config.series[opt.seriesIndex])
|
|
577
|
+
.replace(",", ".");
|
|
578
|
+
}
|
|
579
|
+
if (hasPercentages) {
|
|
580
|
+
let percentage = new Intl.NumberFormat("fr-FR", {
|
|
581
|
+
notation: "compact",
|
|
582
|
+
maximumFractionDigits: 1,
|
|
583
|
+
})
|
|
584
|
+
.format(value)
|
|
585
|
+
.replace(",", ".");
|
|
586
|
+
returnValue = returnValue + " (" + percentage + "%)";
|
|
587
|
+
}
|
|
588
|
+
return returnValue;
|
|
589
|
+
},
|
|
590
|
+
};
|
|
591
|
+
if (props.tooltipOptions) {
|
|
592
|
+
props.options["tooltip"] = props.tooltipOptions;
|
|
593
|
+
}
|
|
594
|
+
props.options["plotOptions"] = {
|
|
595
|
+
pie: {
|
|
596
|
+
dataLabels: {
|
|
597
|
+
offset: -40,
|
|
598
|
+
},
|
|
599
|
+
},
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
return props.options;
|
|
604
|
+
});
|
|
605
|
+
const chartType = computed(() => {
|
|
606
|
+
let selectedType = ref("");
|
|
607
|
+
if (props.type.includes("bar")) {
|
|
608
|
+
selectedType.value = "bar";
|
|
609
|
+
} else {
|
|
610
|
+
selectedType.value = props.type;
|
|
611
|
+
}
|
|
612
|
+
return selectedType.value;
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
watch(
|
|
616
|
+
() => props.series,
|
|
617
|
+
() => {
|
|
618
|
+
chartKey.value += 1;
|
|
619
|
+
}
|
|
620
|
+
);
|
|
621
|
+
|
|
622
|
+
function percentage(partialValue, totalValue) {
|
|
623
|
+
return (100 * partialValue) / totalValue;
|
|
624
|
+
}
|
|
625
|
+
return {
|
|
626
|
+
percentage,
|
|
627
|
+
chartKey,
|
|
628
|
+
chartType,
|
|
629
|
+
chartOptions,
|
|
630
|
+
};
|
|
631
|
+
},
|
|
632
|
+
});
|
|
633
|
+
</script>
|
|
634
|
+
<style>
|
|
635
|
+
.prmt_chart {
|
|
636
|
+
font-family: "Figtree", sans-serif !important;
|
|
637
|
+
position: relative;
|
|
638
|
+
}
|
|
639
|
+
.prmt_chart_title {
|
|
640
|
+
font-style: normal;
|
|
641
|
+
font-weight: 700;
|
|
642
|
+
font-size: 18px;
|
|
643
|
+
line-height: 21px;
|
|
644
|
+
color: var(--independence);
|
|
645
|
+
margin-bottom: 8px;
|
|
646
|
+
margin-right: 150px;
|
|
647
|
+
}
|
|
648
|
+
.prmt_chart_title.prmt_chart_title_without_subtitle {
|
|
649
|
+
margin-bottom: 22px;
|
|
650
|
+
}
|
|
651
|
+
.prmt_chart_source {
|
|
652
|
+
padding: 4px 0;
|
|
653
|
+
display: flex;
|
|
654
|
+
align-items: center;
|
|
655
|
+
gap: 8px;
|
|
656
|
+
font-style: normal;
|
|
657
|
+
font-weight: 400;
|
|
658
|
+
font-size: 12px;
|
|
659
|
+
line-height: 14px;
|
|
660
|
+
color: #2176ff;
|
|
661
|
+
white-space: nowrap;
|
|
662
|
+
text-overflow: ellipsis;
|
|
663
|
+
overflow: hidden;
|
|
664
|
+
display: flex;
|
|
665
|
+
align-items: center;
|
|
666
|
+
height: 14px;
|
|
667
|
+
}
|
|
668
|
+
.prmt_chart_source a {
|
|
669
|
+
color: #2176ff;
|
|
670
|
+
}
|
|
671
|
+
.prmt_chart_source:empty {
|
|
672
|
+
visibility: hidden;
|
|
673
|
+
}
|
|
674
|
+
.prmt_chart .apexcharts-toolbar {
|
|
675
|
+
top: 0 !important;
|
|
676
|
+
}
|
|
677
|
+
.prmt_chart .apexcharts-canvas .apexcharts-svg {
|
|
678
|
+
overflow: visible;
|
|
679
|
+
}
|
|
680
|
+
.prmt_chart .apexcharts-pie-area {
|
|
681
|
+
stroke-width: 0;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.prmt_chart .apexcharts-canvas {
|
|
685
|
+
position: initial;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.apexcharts-bar-series.apexcharts-plot-series .apexcharts-series path {
|
|
689
|
+
clip-path: inset(0% 0% -11% 0% round 6px) !important;
|
|
690
|
+
}
|
|
691
|
+
</style>
|