@@ -174,9 +174,12 @@ function prepareChart() {
174174 source: source .value
175175 });
176176
177+ const legendOffset = FINAL_CONFIG .value .style .chart .legend .show ? 24 : 0 ;
178+ const offsetY = legendOffset || 12 ;
179+
177180 requestAnimationFrame (() => {
178181 defaultSizes .value .width = width;
179- defaultSizes .value .height = height - 12 ;
182+ defaultSizes .value .height = height - offsetY ;
180183 })
181184 });
182185
@@ -286,22 +289,25 @@ const { loading, FINAL_DATASET, manualLoading } = useLoading({
286289const { userOptionsVisible , setUserOptionsVisibility , keepUserOptionState } = useUserOptionState ({ config: FINAL_CONFIG .value });
287290const { svgRef } = useChartAccessibility ({ config: FINAL_CONFIG .value .style .chart .title });
288291
292+ const defaultSizes = ref ({
293+ width: FINAL_CONFIG .value .style .chart .width ,
294+ height: FINAL_CONFIG .value .style .chart .height
295+ });
296+
297+ const WIDTH = computed (() => defaultSizes .value .width );
298+ const HEIGHT = computed (() => defaultSizes .value .height );
299+
289300watch (() => props .config , (_newCfg ) => {
290301 if (! loading .value ) {
291302 FINAL_CONFIG .value = prepareConfig ();
292303 }
293304 userOptionsVisible .value = ! FINAL_CONFIG .value .userOptions .showOnChartHover ;
305+ defaultSizes .value .width = FINAL_CONFIG .value .style .chart .width ;
306+ defaultSizes .value .height = FINAL_CONFIG .value .style .chart .height ;
294307 prepareChart ();
295308 titleStep .value += 1 ;
296309}, { deep: true });
297310
298- const defaultSizes = ref ({
299- width: FINAL_CONFIG .value .style .chart .width ,
300- height: FINAL_CONFIG .value .style .chart .height
301- });
302-
303- const WIDTH = computed (() => defaultSizes .value .width );
304- const HEIGHT = computed (() => defaultSizes .value .height )
305311
306312const svg = computed (() => {
307313 const height = HEIGHT .value ;
@@ -550,7 +556,7 @@ defineExpose({
550556 <div
551557 ref =" bulletChart"
552558 :class =" `vue-data-ui-component vue-ui-bullet ${isFullscreen ? 'vue-data-ui-wrapper-fullscreen' : ''}`"
553- :style =" `font-family:${FINAL_CONFIG.style.fontFamily};width:100%;background:${FINAL_CONFIG.style.chart.backgroundColor}`"
559+ :style =" `font-family:${FINAL_CONFIG.style.fontFamily};width:100%;background:${FINAL_CONFIG.style.chart.backgroundColor};${FINAL_CONFIG.responsive ? 'height:100%' : ''} `"
554560 :id =" `bullet_${uid}`"
555561 @mouseenter =" () => setUserOptionsVisibility(true)"
556562 @mouseleave =" () => setUserOptionsVisibility(false)"
0 commit comments