Skip to content

Commit 9658080

Browse files
authored
Merge pull request #86 from graphieros/ft-formatter
Ft formatter
2 parents 5f8151b + 7aba60e commit 9658080

File tree

84 files changed

+2925
-657
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2925
-657
lines changed

TestingArena/ArenaVueUi3dBar.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,22 @@ const themeOptions = ref([
133133
const currentTheme = ref(themeOptions.value[1])
134134
135135
const config = computed(() => {
136+
const c = convertArrayToObject(model.value);
136137
return {
137-
...convertArrayToObject(model.value),
138+
...c,
139+
style: {
140+
...c.style,
141+
chart: {
142+
...c.style.chart,
143+
dataLabel: {
144+
...c.style.chart.dataLabel,
145+
formatter: ({value, config}) => {
146+
// console.log(config)
147+
return `f | ${value}`
148+
}
149+
}
150+
}
151+
},
138152
theme: currentTheme.value,
139153
customPalette: ['#6376DD', "#DD3322", "#66DDAA"],
140154
}

TestingArena/ArenaVueUiAgePyramid.vue

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,28 @@ const config = computed(() => {
127127
} else {
128128
return {
129129
...c,
130+
style: {
131+
...c.style,
132+
layout: {
133+
...c.style.layout,
134+
dataLabels: {
135+
...c.style.layout.dataLabels,
136+
xAxis: {
137+
...c.style.layout.dataLabels.xAxis,
138+
formatter: ({value, config}) => {
139+
console.log(config)
140+
return `X | ${value}`
141+
}
142+
},
143+
yAxis: {
144+
...c.style.layout.dataLabels.yAxis,
145+
formatter: ({value}) => {
146+
return `Y | ${value}`
147+
}
148+
},
149+
}
150+
}
151+
},
130152
theme: currentTheme.value
131153
}
132154
}

TestingArena/ArenaVueUiChestnut.vue

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,61 @@ const themeOptions = ref([
322322
const currentTheme = ref(themeOptions.value[1])
323323
324324
const config = computed(() => {
325+
const c = convertArrayToObject(model.value);
325326
return {
326-
...convertArrayToObject(model.value),
327+
...c,
328+
style: {
329+
...c.style,
330+
chart: {
331+
...c.style.chart,
332+
layout: {
333+
...c.style.chart.layout,
334+
grandTotal: {
335+
...c.style.chart.layout.grandTotal,
336+
formatter: ({value}) => {
337+
return `tot - ${value}`
338+
}
339+
},
340+
roots: {
341+
...c.style.chart.layout.roots,
342+
labels: {
343+
...c.style.chart.layout.roots.labels,
344+
formatter: ({value, config }) => {
345+
// console.log({config})
346+
return `root - ${value}`
347+
}
348+
}
349+
},
350+
branches: {
351+
...c.style.chart.layout.branches,
352+
labels: {
353+
...c.style.chart.layout.branches.labels,
354+
dataLabels: {
355+
...c.style.chart.layout.branches.labels.dataLabels,
356+
formatter: ({value}) => {
357+
return `branch - ${value}`
358+
}
359+
}
360+
}
361+
},
362+
nuts: {
363+
...c.style.chart.layout.nuts,
364+
selected: {
365+
...c.style.chart.layout.nuts.selected,
366+
labels: {
367+
...c.style.chart.layout.nuts.selected.labels,
368+
dataLabels: {
369+
...c.style.chart.layout.nuts.selected.labels.dataLabels,
370+
formatter: ({value}) => {
371+
return `nut - ${value}`
372+
}
373+
}
374+
}
375+
}
376+
}
377+
}
378+
}
379+
},
327380
theme: currentTheme.value,
328381
customPalette: ['#6376DD', "#DD3322", "#66DDAA"],
329382
}

TestingArena/ArenaVueUiDonut.vue

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ const config = computed(() => {
179179
tooltip: {
180180
...c.style.chart.tooltip,
181181
customFormat: (data) => {
182-
console.log('XY CUSTOM TOOLTIP', data);
183-
return "CUSTOM TOOLTIP"
182+
return "CUSTOM TOOLTIP " + data
184183
}
185184
}
186185
}
@@ -189,6 +188,57 @@ const config = computed(() => {
189188
} else {
190189
return {
191190
...c,
191+
style: {
192+
...c.style,
193+
chart: {
194+
...c.style.chart,
195+
layout: {
196+
...c.style.chart.layout,
197+
labels: {
198+
...c.style.chart.layout.labels,
199+
hollow: {
200+
...c.style.chart.layout.labels.hollow,
201+
total: {
202+
...c.style.chart.layout.labels.hollow.total,
203+
value: {
204+
...c.style.chart.layout.labels.hollow.total.value,
205+
formatter: ({value}) => {
206+
return `f - ${value}`
207+
}
208+
}
209+
},
210+
average: {
211+
...c.style.chart.layout.labels.hollow.average,
212+
value: {
213+
...c.style.chart.layout.labels.hollow.average.value,
214+
formatter: ({value}) => {
215+
return `f - ${value}`
216+
}
217+
}
218+
},
219+
},
220+
value: {
221+
...c.style.chart.layout.labels.value,
222+
formatter: ({value, config}) => {
223+
224+
return `f - ${value}`
225+
}
226+
},
227+
percentage: {
228+
formatter: ({value}) => {
229+
return `f - ${value}`
230+
}
231+
},
232+
dataLabels: {
233+
...c.style.chart.layout.labels.dataLabels,
234+
formatter: ({value}) => {
235+
return `f - ${value}`
236+
}
237+
}
238+
}
239+
},
240+
}
241+
},
192242
theme: currentTheme.value,
193243
// customPalette: ['#6376DD', "#DD3322", "#66DDAA"]
194244
}

TestingArena/ArenaVueUiDonutEvolution.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@ const config = computed(() => {
129129
...c.style.chart,
130130
layout: {
131131
...c.style.chart.layout,
132+
dataLabels: {
133+
...c.style.chart.layout.dataLabels,
134+
formatter: ({value, config}) => {
135+
console.log(config)
136+
return `f | ${value}`
137+
}
138+
},
132139
grid: {
133140
...c.style.chart.layout.grid,
134141
xAxis: {

TestingArena/ArenaVueUiDumbbell.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,22 @@ const themeOptions = ref([
125125
const currentTheme = ref(themeOptions.value[1])
126126
127127
const config = computed(() => {
128+
const c = convertArrayToObject(model.value);
128129
return {
129-
...convertArrayToObject(model.value),
130+
...c,
131+
style: {
132+
...c.style,
133+
chart: {
134+
...c.style.chart,
135+
labels: {
136+
...c.style.chart.labels,
137+
formatter: ({value, config}) => {
138+
// console.log(config)
139+
return `f | ${value}`
140+
}
141+
}
142+
}
143+
},
130144
theme: currentTheme.value
131145
}
132146
})

TestingArena/ArenaVueUiFlow.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,23 @@ const config = computed(() => {
7575
7676
return {
7777
theme: currentTheme.value,
78-
...c
78+
...c,
79+
style: {
80+
...c.style,
81+
chart: {
82+
...c.style.chart,
83+
nodes: {
84+
...c.style.chart.nodes,
85+
labels: {
86+
...c.style.chart.nodes.labels,
87+
formatter: ({value, config}) => {
88+
// console.log(config)
89+
return `f | ${value}`
90+
}
91+
}
92+
}
93+
}
94+
}
7995
}
8096
})
8197

TestingArena/ArenaVueUiGalaxy.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,25 @@ const config = computed(() => {
121121
} else {
122122
return {
123123
...c,
124+
style: {
125+
...c.style,
126+
chart: {
127+
...c.style.chart,
128+
layout: {
129+
...c.style.chart.layout,
130+
labels: {
131+
...c.style.chart.layout.labels,
132+
dataLabels: {
133+
...c.style.chart.layout.labels.dataLabels,
134+
formatter: ({value, config}) => {
135+
console.log(config)
136+
return `f | ${value}`
137+
}
138+
}
139+
}
140+
}
141+
}
142+
},
124143
theme: currentTheme.value,
125144
customPalette: ['#6376DD', "#DD3322", "#66DDAA"],
126145
}

TestingArena/ArenaVueUiGauge.vue

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const dataset = computed(() => {
2121
2222
onMounted(() => {
2323
setTimeout(() => {
24-
source.value.value = -30
24+
source.value.value = 50
2525
step.value += 1
2626
}, 3000)
2727
})
@@ -89,8 +89,21 @@ const themeOptions = ref([
8989
const currentTheme = ref(themeOptions.value[4])
9090
9191
const config = computed(() => {
92+
const c = convertArrayToObject(model.value)
9293
return {
93-
...convertArrayToObject(model.value),
94+
...c,
95+
style: {
96+
...c.style,
97+
chart: {
98+
...c.style.chart,
99+
legend: {
100+
...c.style.chart.legend,
101+
formatter: ({value}) => {
102+
return `f - ${value}`
103+
}
104+
}
105+
}
106+
},
94107
theme: currentTheme.value,
95108
customPalette: ['#6376DD', "#DD3322", "#66DDAA"],
96109
}

TestingArena/ArenaVueUiGizmo.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ const model= ref([
2121
const config = computed(() => {
2222
const c = convertArrayToObject(model.value);
2323
return {
24-
...c
24+
...c,
25+
formatter: ({value}) => {
26+
return `f | ${value}`
27+
}
2528
}
2629
})
2730

TestingArena/ArenaVueUiHeatmap.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@ const config = computed(() => {
142142
...c.style,
143143
layout: {
144144
...c.style.layout,
145+
cells: {
146+
...c.style.layout.cells,
147+
value: {
148+
...c.style.layout.cells.value,
149+
formatter: ({value, config}) => {
150+
console.log(config)
151+
return `f - ${value}`
152+
}
153+
}
154+
},
145155
dataLabels: {
146156
...c.style.layout.dataLabels,
147157
xAxis: {

TestingArena/ArenaVueUiKpi.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ function updateVal() {
1212
dataset.value = Math.random() * 10000
1313
}
1414
15+
const config = ref({
16+
formatter: ({ value }) => {
17+
return `f | ${value}`
18+
}
19+
})
20+
1521
1622
</script>
1723

@@ -24,16 +30,16 @@ function updateVal() {
2430
<template #title>VueUiKpi</template>
2531

2632
<template #local>
27-
<LocalVueUiKpi :dataset="dataset"/>
33+
<LocalVueUiKpi :dataset="dataset" :config="config"/>
2834
</template>
2935
<template #VDUI-local>
30-
<LocalVueDataUi component="VueUiKpi" :dataset="dataset"/>
36+
<LocalVueDataUi component="VueUiKpi" :dataset="dataset" :config="config"/>
3137
</template>
3238
<template #build>
33-
<VueUiKpi :dataset="dataset"/>
39+
<VueUiKpi :dataset="dataset" :config="config"/>
3440
</template>
3541
<template #VDUI-build>
36-
<VueDataUi component="VueUiKpi" :dataset="dataset"/>
42+
<VueDataUi component="VueUiKpi" :dataset="dataset" :config="config"/>
3743
</template>
3844
</Box>
3945
</template>

TestingArena/ArenaVueUiMoodRadar.vue

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,25 @@ const themeOptions = ref([
8787
const currentTheme = ref(themeOptions.value[3])
8888
8989
const config = computed(() => {
90+
const c = convertArrayToObject(model.value);
9091
return {
91-
...convertArrayToObject(model.value),
92+
...c,
93+
style: {
94+
...c.style,
95+
chart: {
96+
...c.style.chart,
97+
layout: {
98+
...c.style.chart.layout,
99+
dataLabel: {
100+
...c.style.chart.layout.dataLabel,
101+
formatter: ({value, config }) => {
102+
// console.log(config)
103+
return `f | ${value}`
104+
}
105+
}
106+
}
107+
}
108+
},
92109
theme: currentTheme.value
93110
}
94111
})

0 commit comments

Comments
 (0)