Skip to content

Commit 3923ea7

Browse files
committed
Fix - VueUiRidgeline - Fix container height overflow in responsive mode
1 parent 4b1fe72 commit 3923ea7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@
110110
"vitest": "^3.1.1",
111111
"vue": "^3.5.14"
112112
}
113-
}
113+
}

src/components/vue-ui-ridgeline.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const baseWidth = ref(512);
8383
const selectedX = ref(null);
8484
const selectedDatapoint = ref(null);
8585
const dialog = ref(null);
86+
const parentHeight = ref(0);
8687
8788
function prepareConfig() {
8889
const mergedConfig = useNestedProp({
@@ -184,12 +185,14 @@ function prepareChart() {
184185
title: FINAL_CONFIG.value.style.chart.title.text ? chartTitle.value : null,
185186
legend: FINAL_CONFIG.value.style.chart.legend.show ? chartLegend.value : null,
186187
source: source.value,
187-
noTitle: noTitle.value
188+
noTitle: noTitle.value,
189+
padding: FINAL_CONFIG.value.style.chart.padding
188190
});
189191
190192
requestAnimationFrame(() => {
191193
baseWidth.value = width;
192194
rowHeight.value = (height / props.dataset.length);
195+
parentHeight.value = height
193196
});
194197
});
195198
@@ -720,7 +723,7 @@ defineExpose({
720723
<svg ref="svgRef" :xmlns="XMLNS" v-if="isDataset"
721724
:class="{ 'vue-data-ui-fullscreen--on': isFullscreen, 'vue-data-ui-fulscreen--off': !isFullscreen }"
722725
:viewBox="`0 0 ${svg.width <= 0 ? 10 : svg.width} ${drawableArea.fullHeight <= 0 ? 10 : drawableArea.fullHeight}`"
723-
:style="`max-width:100%;overflow:visible;background:transparent;color:${FINAL_CONFIG.style.chart.color};${FINAL_CONFIG.responsive ? 'height: 100%; width: 100%;' : ''}`">
726+
:style="`max-width:100%;overflow:visible;background:transparent;color:${FINAL_CONFIG.style.chart.color};${FINAL_CONFIG.responsive ? `height: ${parentHeight}px; width: 100%;` : ''}`">
724727
<defs>
725728
<linearGradient
726729
v-for="(dp, i) in legendSet"

0 commit comments

Comments
 (0)