Skip to content

Commit e88db23

Browse files
committed
Modification - VueUiStackline - Make chart dimensions reactive; align shape markers in tooltip
1 parent d8ecb6e commit e88db23

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/components/vue-ui-stackline.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,14 @@ watch(() => props.config, (_newCfg) => {
285285
mutableConfig.value.dataLabels.show = FINAL_CONFIG.value.style.chart.lines.dataLabels.show;
286286
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
287287
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
288+
defaultSizes.value.width = FINAL_CONFIG.value.style.chart.width;
289+
defaultSizes.value.height = FINAL_CONFIG.value.style.chart.height;
290+
defaultSizes.value.paddingRatio = {
291+
top: FINAL_CONFIG.value.style.chart.padding.top / FINAL_CONFIG.value.style.chart.height,
292+
right: FINAL_CONFIG.value.style.chart.padding.right / FINAL_CONFIG.value.style.chart.width,
293+
bottom: FINAL_CONFIG.value.style.chart.padding.bottom / FINAL_CONFIG.value.style.chart.height,
294+
left: FINAL_CONFIG.value.style.chart.padding.left / FINAL_CONFIG.value.style.chart.width,
295+
}
288296

289297
normalizeSlicerWindow();
290298
}, { deep: true });
@@ -1548,7 +1556,7 @@ const tooltipContent = computed(() => {
15481556

15491557
return `
15501558
<div style="display:flex;flex-direction:row;align-items:center;gap:4px">
1551-
<div style="width:20px;height:20px">${shapeSvg(ds)}</div>
1559+
<div style="width:20px;height:20px;display:flex;align-items:center;justify-content:center;">${shapeSvg(ds)}</div>
15521560
${ds.name}${showValue || withPct ? ':' : ''}
15531561
${showValue ? applyDataLabel(
15541562
FINAL_CONFIG.value.style.chart.lines.dataLabels.formatter,

0 commit comments

Comments
 (0)