@simple-reporting/base 1.0.14 → 1.0.16
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/dev/package.json +1 -1
- package/dev/src/App.vue +2 -7
- package/dev/src/components/{PageHeader.vue → Page/Header.vue} +1 -2
- package/dev/src/views/ArticleView.vue +2 -3
- package/livingdocs/040.Media/010.table/table/download.vue +494 -0
- package/livingdocs/040.Media/010.table/table/responsive.vue +104 -0
- package/livingdocs/040.Media/010.table/table.html +2 -2
- package/livingdocs/040.Media/010.table/table.vue +26 -0
- package/package.json +1 -1
- package/plugins/viteSrlPlugin.d.ts +2 -0
- package/plugins/viteSrlPlugin.js +19 -36
- package/scripts/build.js +17 -0
- package/scripts/ldd/mapLdd.js +2 -2
- package/scripts/vue/components.d.ts +1 -0
- package/scripts/vue/components.js +93 -0
- package/srl/components/Srl/Article/{DialogButton.vue → Dialog/Button.vue} +1 -1
- package/srl/components/Srl/{Note → Category}/Accordion/Content.vue +1 -1
- package/srl/components/Srl/Menu/Item/Content.vue +7 -14
- package/srl/components/Srl/Menu/Item.vue +12 -10
- package/srl/components/Srl/{Menu/List.vue → Menu.vue} +3 -4
- package/srl/components/Srl/Page/Dialog.vue +1 -1
- package/srl/composables/config.ts +13 -14
- package/srl/composables/cssStyles.ts +1 -1
- package/srl/composables/menu.ts +5 -1
- package/srl/composables/viewPort.ts +4 -3
- package/srl/plugins/asyncLdComponent.ts +2 -2
- package/srl/plugins/asyncSrlComponents.ts +2 -0
- package/srl/plugins/initProject.ts +1 -1
- package/srl/plugins/vueSrlPlugin.ts +3 -20
- package/srl/types/components.d.ts +3 -17
- package/srl/types/global.d.ts +7 -0
- package/srl/types/nswow.d.ts +14 -14
- package/srl/utils/html.ts +3 -3
- package/dev/src/components/SrlPage/KFCApplication/KFCApplication.vue +0 -715
- package/dev/src/components/SrlPage/KFCApplication/KFCDropdownCharts.vue +0 -112
- package/dev/src/components/SrlPage/KFCApplication/KFCDropdownPeriod.vue +0 -85
- package/dev/src/components/SrlPage/KFCApplication/KFCTable.vue +0 -63
- package/dev/src/components/SrlPage/KFCApplication/hooks/kfcData.ts +0 -9
- package/dev/src/components/SrlPage/KFCApplication/models/KFCApplication.ts +0 -183
- package/dev/src/components/SrlPage/KFCApplication/scss/_highcharts-basic.scss +0 -1136
- package/dev/src/components/SrlPage/KFCApplication/scss/_highcharts-custom.scss +0 -71
- package/dev/src/components/SrlPage/KFCApplication/scss/_highcharts-general.scss +0 -113
- package/dev/src/components/SrlPage/KFCApplication/scss/_iz-keyfigure-comparison-dropdown.scss +0 -189
- package/dev/src/components/SrlPage/KFCApplication/scss/_iz-keyfigure-comparison.scss +0 -151
- package/dev/src/components/SrlPage/KFCApplication/scss/_kfc-loading.scss +0 -40
- package/dev/src/components/SrlPage/KFCApplication/scss/_kfc-print.scss +0 -20
- package/dev/src/components/SrlPage/KFCApplication/scss/_srl-button-kfc.scss +0 -21
- package/dev/src/components/SrlPage/KFCApplication/scss/_variables.scss +0 -10
- package/dev/src/components/SrlPage/KFCApplication/services/xlsxParser.ts +0 -194
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgColumnView.vue +0 -28
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgDownloadChart.vue +0 -26
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgDropdown.vue +0 -18
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgIndexedValues.vue +0 -18
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgLegendSwap.vue +0 -18
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgLineView.vue +0 -28
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgPDFChart.vue +0 -26
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgPrintChart.vue +0 -33
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgTableView.vue +0 -67
- package/dev/src/components/SrlPage/KFCApplication/utils/XDownloader.js +0 -455
- package/dev/src/components/SrlPage/KFCApplication/utils/XDownloaderStyle.js +0 -44
- package/dev/src/components/SrlPage/KFCApplication/utils/XTableNamer.js +0 -68
- /package/dev/src/components/{BypassLinks.vue → Page/BypassLinks.vue} +0 -0
- /package/dev/src/components/{PageFooter.vue → Page/Footer.vue} +0 -0
- /package/dev/src/components/{PageMain.vue → Page/Main.vue} +0 -0
- /package/dev/src/components/{MainNavigation.vue → Page/MainNavigation.vue} +0 -0
- /package/dev/src/components/{NavLanguages.vue → Page/NavLanguages.vue} +0 -0
- /package/dev/src/components/{PrevNext.vue → Page/PrevNext.vue} +0 -0
- /package/srl/{components/Srl/Page/App.vue → App.vue} +0 -0
- /package/srl/components/Srl/{Note → Category}/Accordion/Toggle.vue +0 -0
- /package/srl/components/Srl/{Note → Category}/Accordion.vue +0 -0
- /package/srl/components/Srl/Menu/Item/Content/{IconAfter.vue → Icon/After.vue} +0 -0
- /package/srl/components/Srl/Menu/Item/Content/{IconBefore.vue → Icon/Before.vue} +0 -0
- /package/srl/components/Srl/Menu/Item/Content/{ImageAfter.vue → Image/After.vue} +0 -0
- /package/srl/components/Srl/Menu/Item/Content/{ImageBefore.vue → Image/Before.vue} +0 -0
|
@@ -1,715 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { onMounted, ref, watch } from 'vue'
|
|
3
|
-
import { useI18n } from 'vue-i18n'
|
|
4
|
-
import * as Highcharts from 'highcharts'
|
|
5
|
-
import exportingModule from 'highcharts/modules/exporting'
|
|
6
|
-
import offlineExporting from 'highcharts/modules/offline-exporting'
|
|
7
|
-
|
|
8
|
-
import { KFCApplication } from '@/components/SrlPage/KFCApplication/models/KFCApplication'
|
|
9
|
-
|
|
10
|
-
import KFCTable from '@/components/SrlPage/KFCApplication/KFCTable.vue'
|
|
11
|
-
import KFCDropdownCharts from '@/components/SrlPage/KFCApplication/KFCDropdownCharts.vue'
|
|
12
|
-
import KFCDropdownPeriod from '@/components/SrlPage/KFCApplication/KFCDropdownPeriod.vue'
|
|
13
|
-
import XDownloader from '@/components/SrlPage/KFCApplication/utils/XDownloader.js'
|
|
14
|
-
import XDownloaderStyle from '@/components/SrlPage/KFCApplication/utils/XDownloaderStyle.js'
|
|
15
|
-
|
|
16
|
-
import SvgColumnView from '@/components/SrlPage/KFCApplication/theme/SvgColumnView.vue'
|
|
17
|
-
import SvgLineView from '@/components/SrlPage/KFCApplication/theme/SvgLineView.vue'
|
|
18
|
-
import SvgTableView from '@/components/SrlPage/KFCApplication/theme/SvgTableView.vue'
|
|
19
|
-
import SvgIndexedValues from '@/components/SrlPage/KFCApplication/theme/SvgIndexedValues.vue'
|
|
20
|
-
import SvgLegendSwap from '@/components/SrlPage/KFCApplication/theme/SvgLegendSwap.vue'
|
|
21
|
-
import SvgDownloadChart from '@/components/SrlPage/KFCApplication/theme/SvgDownloadChart.vue'
|
|
22
|
-
import SvgPDFChart from '@/components/SrlPage/KFCApplication/theme/SvgPDFChart.vue'
|
|
23
|
-
import SvgPrintChart from '@/components/SrlPage/KFCApplication/theme/SvgPrintChart.vue'
|
|
24
|
-
|
|
25
|
-
exportingModule(Highcharts)
|
|
26
|
-
offlineExporting(Highcharts)
|
|
27
|
-
|
|
28
|
-
const { locale } = useI18n()
|
|
29
|
-
const kfcApplication = new KFCApplication(locale.value)
|
|
30
|
-
const renderApplication = ref(false)
|
|
31
|
-
const chartRef = ref()
|
|
32
|
-
const tableRef = ref()
|
|
33
|
-
const kfcChart = ref()
|
|
34
|
-
const decimalPoint = {
|
|
35
|
-
de: '.',
|
|
36
|
-
en: '.',
|
|
37
|
-
it: '.',
|
|
38
|
-
fr: ','
|
|
39
|
-
}
|
|
40
|
-
const thousandsSep = {
|
|
41
|
-
de: ' ',
|
|
42
|
-
en: ',',
|
|
43
|
-
it: ' ',
|
|
44
|
-
fr: ' '
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function hasNthYAxisDisplayed(nth: number) {
|
|
48
|
-
return !!kfcApplication.currentChart.value.series
|
|
49
|
-
.filter((d, i) => kfcApplication.activeSeries.includes(i))
|
|
50
|
-
.find((d) => d.yAxis === nth)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function getSeries() {
|
|
54
|
-
const { swapLabels, indexed } = kfcApplication
|
|
55
|
-
if (swapLabels && indexed) {
|
|
56
|
-
return _getIndexedLabelSwapSeries()
|
|
57
|
-
} else if (swapLabels) {
|
|
58
|
-
return _getLabelSwapSeries()
|
|
59
|
-
} else if (indexed) {
|
|
60
|
-
return _getIndexedSeries()
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return _getSeries()
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function _getSeries() {
|
|
67
|
-
const { currentChart, activeSeries, activeCategories, chartType } = kfcApplication
|
|
68
|
-
const { series } = currentChart.value
|
|
69
|
-
|
|
70
|
-
return series
|
|
71
|
-
.map((serie, serieIndex) => ({
|
|
72
|
-
...serie,
|
|
73
|
-
visible: activeSeries.includes(serieIndex)
|
|
74
|
-
}))
|
|
75
|
-
.map((serie) => {
|
|
76
|
-
const filteredData = serie.data.filter((d, i) => activeCategories.includes(i))
|
|
77
|
-
const transformedType = handleChartTypeSerie(serie.type)
|
|
78
|
-
const newValue = {
|
|
79
|
-
name: serie.label[locale.value],
|
|
80
|
-
colorIndex: serie.colorIndex,
|
|
81
|
-
type: transformedType,
|
|
82
|
-
yAxis: serie.yAxis || 0,
|
|
83
|
-
data: filteredData,
|
|
84
|
-
zIndex: transformedType === 'line' ? 3 : 1,
|
|
85
|
-
stack: undefined,
|
|
86
|
-
stacking: undefined,
|
|
87
|
-
visible: serie.visible
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (serie.stack > 0 && chartType === 'column') {
|
|
91
|
-
newValue.stack = serie.stack
|
|
92
|
-
newValue.stacking = 'default'
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return newValue
|
|
96
|
-
})
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function _getIndexedSeries() {
|
|
100
|
-
return _getSeries().map((serie) => ({
|
|
101
|
-
...serie,
|
|
102
|
-
stack: undefined,
|
|
103
|
-
stacking: undefined,
|
|
104
|
-
data: serie.data.map((d) => {
|
|
105
|
-
if (d <= 0) {
|
|
106
|
-
// N/A
|
|
107
|
-
return 0
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return Math.round(Math.round((d / serie.data[0]) * 10000) / 100)
|
|
111
|
-
})
|
|
112
|
-
}))
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function _getLabelSwapSeries() {
|
|
116
|
-
const { currentChart, activeSeries, activeCategories } = kfcApplication
|
|
117
|
-
const { categories, series, swapColors } = currentChart.value
|
|
118
|
-
|
|
119
|
-
return categories.map((category, categoryIndex) => {
|
|
120
|
-
const categoryData = series
|
|
121
|
-
.map((serie) => serie.data[categoryIndex])
|
|
122
|
-
.filter((s, i) => activeSeries.includes(i))
|
|
123
|
-
return {
|
|
124
|
-
name: category,
|
|
125
|
-
type: 'column',
|
|
126
|
-
stack: undefined,
|
|
127
|
-
yAxis: 0,
|
|
128
|
-
colorIndex: swapColors[categoryIndex],
|
|
129
|
-
data: categoryData,
|
|
130
|
-
visible: activeCategories.includes(categoryIndex)
|
|
131
|
-
}
|
|
132
|
-
})
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function _getIndexedLabelSwapSeries() {
|
|
136
|
-
const swappedSeries = _getLabelSwapSeries()
|
|
137
|
-
const baseSeries = swappedSeries.find((x) => x.visible)
|
|
138
|
-
|
|
139
|
-
const indexed = swappedSeries.map((serie) => {
|
|
140
|
-
return {
|
|
141
|
-
...serie,
|
|
142
|
-
stack: undefined,
|
|
143
|
-
stacking: undefined,
|
|
144
|
-
data: serie.data.map((d, di) => {
|
|
145
|
-
if (d <= 0) {
|
|
146
|
-
// N/A
|
|
147
|
-
return 0
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return Math.round(Math.round((d / baseSeries.data[di]) * 10000) / 100)
|
|
151
|
-
})
|
|
152
|
-
}
|
|
153
|
-
})
|
|
154
|
-
|
|
155
|
-
return indexed
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function getCategories() {
|
|
159
|
-
const { swapLabels } = kfcApplication
|
|
160
|
-
|
|
161
|
-
if (swapLabels) {
|
|
162
|
-
return _getLabelSwapCategories()
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return _getCategories()
|
|
166
|
-
}
|
|
167
|
-
function _getCategories() {
|
|
168
|
-
const { activeCategories, currentChart } = kfcApplication
|
|
169
|
-
const { categories } = currentChart.value
|
|
170
|
-
|
|
171
|
-
return categories.filter((x, i) => activeCategories.includes(i))
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function _getLabelSwapCategories() {
|
|
175
|
-
const { currentChart, activeSeries } = kfcApplication
|
|
176
|
-
const { series } = currentChart.value
|
|
177
|
-
|
|
178
|
-
return series
|
|
179
|
-
.map((serie) => serie.label[locale.value])
|
|
180
|
-
.filter((serie, i) => activeSeries.includes(i))
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function updateCategories(newCategories) {
|
|
184
|
-
kfcApplication.activeCategories = newCategories.sort()
|
|
185
|
-
kfcApplication.writeQuery()
|
|
186
|
-
updateChart()
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function updateSeries(newSeries) {
|
|
190
|
-
kfcApplication.activeSeries = newSeries.sort()
|
|
191
|
-
kfcApplication.writeQuery()
|
|
192
|
-
updateChart()
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
function toggleIndexed() {
|
|
196
|
-
kfcApplication.indexed = !kfcApplication.indexed
|
|
197
|
-
kfcApplication.writeQuery()
|
|
198
|
-
renderChart()
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function toggleSwapLabels() {
|
|
202
|
-
if (kfcApplication.canSwapLabels()) {
|
|
203
|
-
kfcApplication.swapLabels = !kfcApplication.swapLabels
|
|
204
|
-
} else {
|
|
205
|
-
kfcApplication.swapLabels = false
|
|
206
|
-
}
|
|
207
|
-
kfcApplication.writeQuery()
|
|
208
|
-
renderChart()
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
function updateActiveChart(newChart) {
|
|
212
|
-
kfcApplication.updateActiveChart(newChart)
|
|
213
|
-
kfcApplication.writeQuery()
|
|
214
|
-
renderChart()
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function changeChartType(chartType) {
|
|
218
|
-
kfcApplication.chartType = chartType
|
|
219
|
-
kfcApplication.swapLabels = false
|
|
220
|
-
kfcApplication.writeQuery()
|
|
221
|
-
renderChart()
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
function handleChartTypeSerie(serie) {
|
|
225
|
-
if (kfcApplication.chartType == 'line') {
|
|
226
|
-
if (serie == 'column') return 'line'
|
|
227
|
-
if (serie == 'line') return 'column'
|
|
228
|
-
return serie
|
|
229
|
-
}
|
|
230
|
-
return serie
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
function seriesStateChangedEvent(event) {
|
|
234
|
-
if (!event?.legendItem) {
|
|
235
|
-
//console.error('LEGEND ITEM IS UNDEFINED')
|
|
236
|
-
return
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
const { activeCategories, activeSeries, swapLabels } = kfcApplication
|
|
240
|
-
const { index, visible } = event.legendItem
|
|
241
|
-
|
|
242
|
-
event.preventDefault()
|
|
243
|
-
|
|
244
|
-
if (swapLabels) {
|
|
245
|
-
if (visible) {
|
|
246
|
-
updateCategories([...activeCategories.filter((x) => x !== index)])
|
|
247
|
-
} else {
|
|
248
|
-
updateCategories([...activeCategories, index])
|
|
249
|
-
}
|
|
250
|
-
} else {
|
|
251
|
-
if (visible) {
|
|
252
|
-
updateSeries(activeSeries.filter((x) => x !== index))
|
|
253
|
-
} else {
|
|
254
|
-
updateSeries([...activeSeries, index])
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
function updateChart() {
|
|
260
|
-
if (chartRef.value && chartRef.value && chartRef.value.destroy) {
|
|
261
|
-
chartRef.value.update(
|
|
262
|
-
{
|
|
263
|
-
series: getSeries(),
|
|
264
|
-
xAxis: { categories: getCategories() }
|
|
265
|
-
},
|
|
266
|
-
true
|
|
267
|
-
)
|
|
268
|
-
chartRef.value.yAxis[0].update({
|
|
269
|
-
title: {
|
|
270
|
-
enabled: hasNthYAxisDisplayed(0),
|
|
271
|
-
text: kfcApplication.indexed
|
|
272
|
-
? '%'
|
|
273
|
-
: kfcApplication.currentChart.value.yAxisLabel0[locale.value]
|
|
274
|
-
}
|
|
275
|
-
})
|
|
276
|
-
chartRef.value.yAxis[1].update({
|
|
277
|
-
title: {
|
|
278
|
-
enabled: hasNthYAxisDisplayed(1),
|
|
279
|
-
text: kfcApplication.indexed
|
|
280
|
-
? '%'
|
|
281
|
-
: kfcApplication.currentChart.value.yAxisLabel1[locale.value]
|
|
282
|
-
}
|
|
283
|
-
})
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
function renderChart() {
|
|
288
|
-
Highcharts.setOptions({
|
|
289
|
-
lang: {
|
|
290
|
-
decimalPoint: decimalPoint[locale.value],
|
|
291
|
-
thousandsSep: thousandsSep[locale.value]
|
|
292
|
-
}
|
|
293
|
-
})
|
|
294
|
-
|
|
295
|
-
if (!kfcApplication.currentChart) {
|
|
296
|
-
return
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
if (kfcApplication.chartType == 'table') {
|
|
300
|
-
// table does not need to update highchart
|
|
301
|
-
return
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
if (chartRef.value && chartRef.value && chartRef.value.destroy) {
|
|
305
|
-
try {
|
|
306
|
-
chartRef.value.destroy()
|
|
307
|
-
} catch (error) {
|
|
308
|
-
//
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
try {
|
|
312
|
-
chartRef.value = Highcharts.chart(document.querySelector('#kfc-chart'), {
|
|
313
|
-
responsive: {
|
|
314
|
-
rules: [
|
|
315
|
-
{
|
|
316
|
-
condition: {
|
|
317
|
-
maxWidth: 700
|
|
318
|
-
},
|
|
319
|
-
chartOptions: {
|
|
320
|
-
chart: {
|
|
321
|
-
height: '150%'
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
]
|
|
326
|
-
},
|
|
327
|
-
chart: {
|
|
328
|
-
height: '56.9%',
|
|
329
|
-
styledMode: true,
|
|
330
|
-
spacingLeft: 5,
|
|
331
|
-
spacingRight: 5,
|
|
332
|
-
spacingBottom: 0,
|
|
333
|
-
reflow: true
|
|
334
|
-
},
|
|
335
|
-
legend: {
|
|
336
|
-
layout: 'horizontal',
|
|
337
|
-
alignColumns: false,
|
|
338
|
-
align: 'left',
|
|
339
|
-
symbolRadius: 0,
|
|
340
|
-
events: {
|
|
341
|
-
itemClick: (e) => seriesStateChangedEvent(e)
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
plotOptions: {
|
|
345
|
-
line: {
|
|
346
|
-
marker: {
|
|
347
|
-
symbol: 'circle'
|
|
348
|
-
}
|
|
349
|
-
},
|
|
350
|
-
column: {
|
|
351
|
-
borderRadius: 0,
|
|
352
|
-
legendSymbol: 'rectangle',
|
|
353
|
-
pointPadding: 0
|
|
354
|
-
},
|
|
355
|
-
series: {
|
|
356
|
-
marker: {
|
|
357
|
-
height: 8,
|
|
358
|
-
width: 8
|
|
359
|
-
},
|
|
360
|
-
dataLabels: {
|
|
361
|
-
formatter: function () {
|
|
362
|
-
return Highcharts.numberFormat(this.y, 2)
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
},
|
|
367
|
-
title: {
|
|
368
|
-
enabled: false,
|
|
369
|
-
text: kfcApplication.currentChart.value.label
|
|
370
|
-
},
|
|
371
|
-
credits: {
|
|
372
|
-
enabled: false
|
|
373
|
-
},
|
|
374
|
-
series: getSeries(),
|
|
375
|
-
yAxis: [
|
|
376
|
-
{
|
|
377
|
-
title: {
|
|
378
|
-
enabled: hasNthYAxisDisplayed(0),
|
|
379
|
-
text: kfcApplication.indexed
|
|
380
|
-
? '%'
|
|
381
|
-
: kfcApplication.currentChart.value.yAxisLabel0[locale.value]
|
|
382
|
-
},
|
|
383
|
-
reversedStacks: false,
|
|
384
|
-
labels: {},
|
|
385
|
-
tickAmount: 8
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
reversedStacks: false,
|
|
389
|
-
allowDecimals: false,
|
|
390
|
-
title: {
|
|
391
|
-
enabled: hasNthYAxisDisplayed(1),
|
|
392
|
-
text: kfcApplication.indexed
|
|
393
|
-
? '%'
|
|
394
|
-
: kfcApplication.currentChart.value.yAxisLabel1[locale.value]
|
|
395
|
-
},
|
|
396
|
-
labels: {},
|
|
397
|
-
opposite: true,
|
|
398
|
-
tickAmount: 8
|
|
399
|
-
}
|
|
400
|
-
],
|
|
401
|
-
xAxis: {
|
|
402
|
-
categories: getCategories()
|
|
403
|
-
},
|
|
404
|
-
exporting: {
|
|
405
|
-
enabled: false
|
|
406
|
-
},
|
|
407
|
-
tooltip: {
|
|
408
|
-
useHTML: true,
|
|
409
|
-
shadow: false,
|
|
410
|
-
borderWidth: 0,
|
|
411
|
-
className: 'kfc-tooltip',
|
|
412
|
-
formatter: function (tooltip) {
|
|
413
|
-
if (kfcApplication.indexed) {
|
|
414
|
-
if (this.y == 100) {
|
|
415
|
-
return `<div>${this.y}%</div>`
|
|
416
|
-
} else if (this.y == 0) {
|
|
417
|
-
return `<div>n/a</div>`
|
|
418
|
-
}
|
|
419
|
-
return `
|
|
420
|
-
<div>
|
|
421
|
-
${this.y}%
|
|
422
|
-
<br>Δ ${this.y - 100 > 0 ? '+' : ''}${Highcharts.numberFormat(
|
|
423
|
-
Math.round((this.y - 100) * 100) / 100,
|
|
424
|
-
-1
|
|
425
|
-
)}%
|
|
426
|
-
</div>`
|
|
427
|
-
} else {
|
|
428
|
-
//console.log(this)
|
|
429
|
-
const axisStr = this.point?.series?.yAxis?.axisTitle
|
|
430
|
-
? this.point.series.yAxis.axisTitle.textStr
|
|
431
|
-
: ''
|
|
432
|
-
return `${this.x}<br>
|
|
433
|
-
<span class="tooltip-series-color color-${this.colorIndex}" data-series-color="${this.colorIndex}"></span>
|
|
434
|
-
${this.series.name}: <span class="tooltip-series-value">${Highcharts.numberFormat(this.y, 1)} ${axisStr}</span>`
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
})
|
|
439
|
-
} catch (error) {
|
|
440
|
-
console.error('Error creating chart', error)
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
function downloadExcel() {
|
|
445
|
-
new XDownloader({
|
|
446
|
-
tableTitle: kfcApplication.currentChart.value.title[locale.value],
|
|
447
|
-
tableSelector: '.iz-keyfigure-comparison__table',
|
|
448
|
-
downloadText: '',
|
|
449
|
-
styles: XDownloaderStyle,
|
|
450
|
-
mergeStrings: []
|
|
451
|
-
})
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
function printPage() {
|
|
455
|
-
document.body.classList.add('pdf-print')
|
|
456
|
-
setTimeout(() => {
|
|
457
|
-
window.print()
|
|
458
|
-
document.body.classList.remove('pdf-print')
|
|
459
|
-
}, 500)
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
function exportHighchart() {
|
|
463
|
-
chartRef.value.exportChartLocal(
|
|
464
|
-
{
|
|
465
|
-
type: 'image/png',
|
|
466
|
-
filename: kfcApplication.currentChart.value.title[locale.value]
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
chart: {
|
|
470
|
-
width: 800,
|
|
471
|
-
height: 600
|
|
472
|
-
},
|
|
473
|
-
title: {
|
|
474
|
-
enabled: true,
|
|
475
|
-
text: kfcApplication.currentChart.value.title[locale.value]
|
|
476
|
-
},
|
|
477
|
-
subtitle: {
|
|
478
|
-
enabled: false,
|
|
479
|
-
text: kfcApplication.currentChart.value.title[locale.value]
|
|
480
|
-
},
|
|
481
|
-
|
|
482
|
-
yAxis: [
|
|
483
|
-
{
|
|
484
|
-
title: {
|
|
485
|
-
enabled: true,
|
|
486
|
-
text: kfcApplication.indexed
|
|
487
|
-
? '%'
|
|
488
|
-
: kfcApplication.currentChart.value.yAxisLabel0[locale.value]
|
|
489
|
-
}
|
|
490
|
-
},
|
|
491
|
-
{
|
|
492
|
-
title: {
|
|
493
|
-
enabled: true,
|
|
494
|
-
text: kfcApplication.indexed
|
|
495
|
-
? '%'
|
|
496
|
-
: kfcApplication.currentChart.value.yAxisLabel1[locale.value]
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
]
|
|
500
|
-
}
|
|
501
|
-
)
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
function reloadApplication(count = 0) {
|
|
505
|
-
if (count > 100) {
|
|
506
|
-
console.error('KFC Application not loaded')
|
|
507
|
-
return
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
setTimeout(() => {
|
|
511
|
-
if (kfcApplication.dataLoaded.value) {
|
|
512
|
-
if (!window.location.search || window.location.search == '') {
|
|
513
|
-
kfcApplication.writeDefaultQuery()
|
|
514
|
-
} else {
|
|
515
|
-
kfcApplication.readQuery()
|
|
516
|
-
}
|
|
517
|
-
renderApplication.value = true
|
|
518
|
-
setTimeout(() => {
|
|
519
|
-
renderChart()
|
|
520
|
-
}, 300)
|
|
521
|
-
} else {
|
|
522
|
-
reloadApplication(count++)
|
|
523
|
-
}
|
|
524
|
-
}, 300)
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
watch(locale, () => {
|
|
528
|
-
kfcApplication.currentLang.value = locale.value
|
|
529
|
-
})
|
|
530
|
-
|
|
531
|
-
onMounted(() => {
|
|
532
|
-
Highcharts.setOptions({
|
|
533
|
-
lang: {
|
|
534
|
-
numericSymbols: null,
|
|
535
|
-
thousandsSep: "'",
|
|
536
|
-
decimalPoint: decimalPoint[locale.value]
|
|
537
|
-
}
|
|
538
|
-
})
|
|
539
|
-
reloadApplication()
|
|
540
|
-
})
|
|
541
|
-
</script>
|
|
542
|
-
|
|
543
|
-
<template>
|
|
544
|
-
<div v-if="renderApplication" class="srl-kfc">
|
|
545
|
-
<div class="iz-content__content iz-keyfigure-comparison">
|
|
546
|
-
<div class="srl-article__grid srl-article__grid--kfc srl-mt-400">
|
|
547
|
-
<div class="srl-article__grid--inner">
|
|
548
|
-
<KFCDropdownCharts
|
|
549
|
-
:charts="kfcApplication.getCharts()"
|
|
550
|
-
:activeSeries="kfcApplication.activeSeries"
|
|
551
|
-
:activeChart="kfcApplication.activeChart"
|
|
552
|
-
:changeChart="updateActiveChart"
|
|
553
|
-
:updateSeries="updateSeries"
|
|
554
|
-
>
|
|
555
|
-
</KFCDropdownCharts>
|
|
556
|
-
<KFCDropdownPeriod
|
|
557
|
-
:categories="kfcApplication.currentChart.value.categories"
|
|
558
|
-
:active-categories="kfcApplication.activeCategories"
|
|
559
|
-
:updateCategories="updateCategories"
|
|
560
|
-
>
|
|
561
|
-
</KFCDropdownPeriod>
|
|
562
|
-
</div>
|
|
563
|
-
</div>
|
|
564
|
-
<div class="srl-article__grid srl-article__grid--kfc srl-mt-900">
|
|
565
|
-
<div class="srl-article__grid--inner">
|
|
566
|
-
<h2 class="srl-title-h2 srl-component srl-title srl-color-dark kfc-chart-title">
|
|
567
|
-
<span
|
|
568
|
-
class="srl-typo-headline2"
|
|
569
|
-
v-text="kfcApplication.currentChart.value.title[locale]"
|
|
570
|
-
>
|
|
571
|
-
</span>
|
|
572
|
-
</h2>
|
|
573
|
-
<div class="iz-keyfigure-comparison__export-actions kfc-chart-actions">
|
|
574
|
-
<button
|
|
575
|
-
class="srl-button-kfc srl-button-kfc-icon srl-typo-copy2 srl-color-dark"
|
|
576
|
-
@click="exportHighchart()"
|
|
577
|
-
>
|
|
578
|
-
<SvgPrintChart></SvgPrintChart>
|
|
579
|
-
<span>{{ $t('kfc.labels.action.png') }}</span>
|
|
580
|
-
</button>
|
|
581
|
-
<button
|
|
582
|
-
class="srl-button-kfc srl-button-kfc-icon srl-typo-copy2 srl-color-dark"
|
|
583
|
-
@click="downloadExcel()"
|
|
584
|
-
>
|
|
585
|
-
<SvgDownloadChart></SvgDownloadChart>
|
|
586
|
-
<span>{{ $t('kfc.labels.action.xls') }}</span>
|
|
587
|
-
</button>
|
|
588
|
-
<button
|
|
589
|
-
class="srl-button-kfc srl-button-kfc-icon srl-typo-copy2 srl-color-dark"
|
|
590
|
-
@click="printPage()"
|
|
591
|
-
>
|
|
592
|
-
<SvgPDFChart></SvgPDFChart>
|
|
593
|
-
<span>{{ $t('kfc.labels.action.print') }}</span>
|
|
594
|
-
</button>
|
|
595
|
-
</div>
|
|
596
|
-
</div>
|
|
597
|
-
</div>
|
|
598
|
-
<div class="srl-article__grid srl-article__grid--kfc srl-mt-600">
|
|
599
|
-
<div class="srl-article__grid--inner">
|
|
600
|
-
<div class="iz-kfc-chart-types">
|
|
601
|
-
<button
|
|
602
|
-
class="srl-button-kfc"
|
|
603
|
-
:class="{ active: kfcApplication.chartType == 'column' }"
|
|
604
|
-
@click="changeChartType('column')"
|
|
605
|
-
>
|
|
606
|
-
<SvgColumnView></SvgColumnView>
|
|
607
|
-
</button>
|
|
608
|
-
<button
|
|
609
|
-
class="srl-button-kfc"
|
|
610
|
-
:class="{ active: kfcApplication.chartType == 'line' }"
|
|
611
|
-
@click="changeChartType('line')"
|
|
612
|
-
>
|
|
613
|
-
<SvgLineView></SvgLineView>
|
|
614
|
-
</button>
|
|
615
|
-
<button
|
|
616
|
-
class="srl-button-kfc"
|
|
617
|
-
:class="{ active: kfcApplication.chartType == 'table' }"
|
|
618
|
-
@click="changeChartType('table')"
|
|
619
|
-
>
|
|
620
|
-
<SvgTableView></SvgTableView>
|
|
621
|
-
</button>
|
|
622
|
-
</div>
|
|
623
|
-
|
|
624
|
-
<div class="iz-kfc-chart-toggles">
|
|
625
|
-
<button
|
|
626
|
-
@click="toggleIndexed()"
|
|
627
|
-
class="srl-button-kfc srl-button-kfc-icon srl-typo-copy2 srl-color-dark"
|
|
628
|
-
>
|
|
629
|
-
<SvgIndexedValues></SvgIndexedValues>
|
|
630
|
-
<span v-if="!kfcApplication.indexed">{{ $t('kfc.indexed.indexed') }}</span>
|
|
631
|
-
<span v-else>{{ $t('kfc.indexed.absolute') }}</span>
|
|
632
|
-
</button>
|
|
633
|
-
<button
|
|
634
|
-
@click="toggleSwapLabels()"
|
|
635
|
-
v-if="kfcApplication.canSwapLabels() && kfcApplication.chartType == 'column'"
|
|
636
|
-
class="srl-button-kfc srl-button-kfc-icon srl-typo-copy2 srl-color-dark"
|
|
637
|
-
:class="{ active: kfcApplication.swapLabels }"
|
|
638
|
-
>
|
|
639
|
-
<SvgLegendSwap></SvgLegendSwap>
|
|
640
|
-
<span>{{ $t('kfc.swaplabels') }}</span>
|
|
641
|
-
</button>
|
|
642
|
-
</div>
|
|
643
|
-
</div>
|
|
644
|
-
</div>
|
|
645
|
-
|
|
646
|
-
<div class="srl-article__grid srl-article__grid--kfc srl-mt-600">
|
|
647
|
-
<div class="srl-article__grid--inner">
|
|
648
|
-
<div
|
|
649
|
-
id="kfc-chart"
|
|
650
|
-
class="iz-keyfigure-comparison__chart"
|
|
651
|
-
:class="{ hidden: kfcApplication.chartType == 'table' }"
|
|
652
|
-
></div>
|
|
653
|
-
<div class="iz-keyfigure-comparison__table">
|
|
654
|
-
<KFCTable
|
|
655
|
-
:currentChart="kfcApplication.currentChart"
|
|
656
|
-
:class="{ hidden: kfcApplication.chartType != 'table' }"
|
|
657
|
-
:categories="
|
|
658
|
-
kfcApplication.currentChart.value.categories?.filter((c, i) =>
|
|
659
|
-
kfcApplication.activeCategories.includes(i)
|
|
660
|
-
)
|
|
661
|
-
"
|
|
662
|
-
:series="
|
|
663
|
-
kfcApplication.currentChart.value.series
|
|
664
|
-
?.filter((s, i) => kfcApplication.activeSeries.includes(i))
|
|
665
|
-
.map((d) => ({
|
|
666
|
-
...d,
|
|
667
|
-
data: d.data.filter((a, i) => kfcApplication.activeCategories.includes(i))
|
|
668
|
-
}))
|
|
669
|
-
"
|
|
670
|
-
>
|
|
671
|
-
</KFCTable>
|
|
672
|
-
</div>
|
|
673
|
-
</div>
|
|
674
|
-
</div>
|
|
675
|
-
</div>
|
|
676
|
-
|
|
677
|
-
<div class="srl-article__grid srl-article__grid--kfc srl-mt-300">
|
|
678
|
-
<div class="srl-article__grid--inner">
|
|
679
|
-
<p
|
|
680
|
-
class="iz-keyfigure-comparison__footnote"
|
|
681
|
-
v-for="(footnote, footnoteIndex) in kfcApplication.currentChart.value.footnotes"
|
|
682
|
-
v-bind:key="footnoteIndex"
|
|
683
|
-
>
|
|
684
|
-
<span class="iz-keyfigure-comparison__footnote-key" v-html="footnote.key"></span>
|
|
685
|
-
<span class="iz-keyfigure-comparison__footnote-text">{{ footnote.value[locale] }}</span>
|
|
686
|
-
</p>
|
|
687
|
-
</div>
|
|
688
|
-
</div>
|
|
689
|
-
</div>
|
|
690
|
-
<div v-else class="srl-kfc">
|
|
691
|
-
<div class="iz-content__content">
|
|
692
|
-
<div class="srl-article__grid srl-article__grid--kfc srl-mt-900">
|
|
693
|
-
<div class="srl-article__grid--inner">
|
|
694
|
-
<p class="srl-typo-copy1 srl-color-primary loading-text">
|
|
695
|
-
{{ $t('kfcLoadingText') }}
|
|
696
|
-
</p>
|
|
697
|
-
<div class="loader-container">
|
|
698
|
-
<span class="loader"></span>
|
|
699
|
-
</div>
|
|
700
|
-
</div>
|
|
701
|
-
</div>
|
|
702
|
-
</div>
|
|
703
|
-
</div>
|
|
704
|
-
</template>
|
|
705
|
-
|
|
706
|
-
<style lang="scss">
|
|
707
|
-
@use 'scss/_highcharts-basic';
|
|
708
|
-
@use 'scss/_highcharts-general';
|
|
709
|
-
@use 'scss/_highcharts-custom';
|
|
710
|
-
@use 'scss/_iz-keyfigure-comparison';
|
|
711
|
-
@use 'scss/_iz-keyfigure-comparison-dropdown';
|
|
712
|
-
@use 'scss/_srl-button-kfc';
|
|
713
|
-
@use 'scss/_kfc-loading';
|
|
714
|
-
@use 'scss/_kfc-print';
|
|
715
|
-
</style>
|