Skip to content

Commit e287dab

Browse files
committed
VueUi3dBar major improvement adding stacked bar dataset option
1 parent df9ae78 commit e287dab

File tree

8 files changed

+478
-51
lines changed

8 files changed

+478
-51
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-data-ui",
33
"private": false,
4-
"version": "2.0.75",
4+
"version": "2.0.76",
55
"type": "module",
66
"description": "A user-empowering data visualization Vue components library",
77
"keywords": [

src/App.vue

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,7 +2289,37 @@ const moodRadarConfig = ref({
22892289
})
22902290
22912291
const bar3dDataset = ref({
2292-
percentage: 66
2292+
percentage: 66,
2293+
series: [
2294+
{
2295+
name: 'Serie 1 with a long name',
2296+
value: 120
2297+
},
2298+
{
2299+
name: 'Serie 2',
2300+
value: 67
2301+
},
2302+
{
2303+
name: 'Serie 3',
2304+
value: 115
2305+
},
2306+
{
2307+
name: 'Serie 4',
2308+
value: 25
2309+
},
2310+
{
2311+
name: 'Serie 4',
2312+
value: 25
2313+
},
2314+
{
2315+
name: 'Serie 5',
2316+
value: 6
2317+
},
2318+
{
2319+
name: 'Serie 6',
2320+
value: 6
2321+
},
2322+
]
22932323
})
22942324
22952325
const clusterDataset = ref([
@@ -3056,6 +3086,26 @@ function treemapSelect(data) {
30563086
console.log(data)
30573087
}
30583088
3089+
const bar3dConfig = ref({
3090+
style: {
3091+
shape: 'bar',
3092+
chart: {
3093+
backgroundColor: '#1A1A1A',
3094+
color: '#CCCCCC',
3095+
title: {
3096+
text: "Title",
3097+
subtitle: {
3098+
text: "Subtitle"
3099+
}
3100+
}
3101+
}
3102+
}
3103+
})
3104+
3105+
function selectBar(bar) {
3106+
console.log(bar)
3107+
}
3108+
30593109
</script>
30603110

30613111
<template>
@@ -3405,7 +3455,7 @@ function treemapSelect(data) {
34053455
</template>
34063456
</Box>
34073457

3408-
<Box @copy="copyConfig(PROD_CONFIG.vue_ui_3d_bar)">
3458+
<Box open @copy="copyConfig(PROD_CONFIG.vue_ui_3d_bar)">
34093459
<template #title>
34103460
<BaseIcon name="chart3dBar"/>
34113461
VueUi3dBar
@@ -3416,17 +3466,11 @@ function treemapSelect(data) {
34163466
<BaseIcon name="fullscreen" stroke="#5f8bee"/>
34173467
</template>
34183468
<template #dev>
3419-
<VueDataUiTest component="VueUi3dBar" :dataset="bar3dDataset">
3420-
<template #svg="{ svg }">
3421-
<circle :cx="svg.width / 2" :cy="svg.height / 2" :r="30" fill="#FF000033"/>
3422-
</template>
3469+
<VueDataUiTest @selectDatapoint="selectBar" component="VueUi3dBar" :dataset="bar3dDataset" :config="bar3dConfig">
34233470
</VueDataUiTest>
34243471
</template>
34253472
<template #prod>
34263473
<VueDataUi component="VueUi3dBar" :dataset="bar3dDataset">
3427-
<template #svg="{ svg }">
3428-
<circle :cx="svg.width / 2" :cy="svg.height / 2" :r="30" fill="#FF000033"/>
3429-
</template>
34303474
</VueDataUi>
34313475
</template>
34323476
<template #config>
@@ -4126,7 +4170,7 @@ function treemapSelect(data) {
41264170
</template>
41274171
</Box>
41284172

4129-
<Box @copy="copyConfig(PROD_CONFIG.vue_ui_donut)">
4173+
<Box open @copy="copyConfig(PROD_CONFIG.vue_ui_donut)">
41304174
<template #title>
41314175
<BaseIcon name="chartDonut" />
41324176
VueUiDonut

src/components/vue-data-ui.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,11 @@ defineExpose({
345345
v-if="component === 'VueUi3dBar'"
346346
:config="config"
347347
:dataset="dataset" ref="vue_ui_3d_bar"
348+
@selectDatapoint="(datapoint) => emit('selectDatapoint', datapoint)"
348349
>
350+
<template #legend="{ datapoint, config, dataset }">
351+
<slot name="legend" v-bind:legend="{ datapoint, config, dataset }" />
352+
</template>
349353
<template #svg="{ svg }">
350354
<slot name="svg" :svg="svg"></slot>
351355
</template>

0 commit comments

Comments
 (0)