@@ -19,6 +19,7 @@ import { throttle } from "../canvas-lib";
19
19
import themes from " ../themes.json" ;
20
20
import UserOptions from " ../atoms/UserOptions.vue" ;
21
21
import Skeleton from " ./vue-ui-skeleton.vue" ;
22
+ import Title from " ../atoms/Title.vue" ;
22
23
import { useNestedProp } from " ../useNestedProp" ;
23
24
import { usePrinter } from " ../usePrinter" ;
24
25
import { useResponsive } from " ../useResponsive" ;
@@ -357,17 +358,24 @@ defineExpose({
357
358
:id =" `vue-ui-gauge_${uid}`"
358
359
:style =" `font-family:${FINAL_CONFIG.style.fontFamily};width:100%; text-align:center;background:${FINAL_CONFIG.style.chart.backgroundColor};${FINAL_CONFIG.responsive ? 'height: 100%' : ''}`"
359
360
>
360
- <!-- TITLE AS DIV -->
361
- <div ref =" chartTitle" v-if =" FINAL_CONFIG.style.chart.title.text" :style =" `width:100%;background:${FINAL_CONFIG.style.chart.backgroundColor};padding-bottom:12px;${FINAL_CONFIG.userOptions.show ? 'padding-top:36px' : ''}`" >
362
- <div data-cy =" gauge-div-title" :style =" `width:100%;text-align:center;color:${FINAL_CONFIG.style.chart.title.color};font-size:${FINAL_CONFIG.style.chart.title.fontSize}px;font-weight:${FINAL_CONFIG.style.chart.title.bold ? 'bold': ''}`" >
363
- {{ FINAL_CONFIG.style.chart.title.text }}
364
- </div >
365
- <div data-cy =" gauge-div-subtitle" v-if =" FINAL_CONFIG.style.chart.title.subtitle.text" :style =" `width:100%;text-align:center;color:${FINAL_CONFIG.style.chart.title.subtitle.color};font-size:${FINAL_CONFIG.style.chart.title.subtitle.fontSize}px;font-weight:${FINAL_CONFIG.style.chart.title.subtitle.bold ? 'bold': ''}`" >
366
- {{ FINAL_CONFIG.style.chart.title.subtitle.text }}
367
- </div >
368
- <div data-cy =" gauge-div-base" v-if =" !isNaN(dataset.base)" :style =" `width:100%;text-align:center;color:${FINAL_CONFIG.style.chart.title.subtitle.color};font-size:${FINAL_CONFIG.style.chart.title.subtitle.fontSize}px;font-weight:${FINAL_CONFIG.style.chart.title.subtitle.bold ? 'bold': ''}`" >
369
- {{ FINAL_CONFIG.translations.base }} : {{ dataset.base }}
370
- </div >
361
+
362
+ <div ref =" chartTitle" v-if =" FINAL_CONFIG.style.chart.title.text" :style =" `width:100%;background:${FINAL_CONFIG.style.chart.backgroundColor};padding-bottom:12px`" >
363
+ <Title
364
+ :config =" {
365
+ title: {
366
+ cy: 'gauge-div-title',
367
+ ...FINAL_CONFIG.style.chart.title,
368
+ },
369
+ subtitle: {
370
+ cy: 'gauge-div-subtitle',
371
+ ...FINAL_CONFIG.style.chart.title.subtitle
372
+ }
373
+ }"
374
+ >
375
+ <span v-if =" FINAL_CONFIG.translations.base && dataset.base" >
376
+ {{ FINAL_CONFIG.translations.base }}: {{ dataset.base }}
377
+ </span >
378
+ </Title >
371
379
</div >
372
380
373
381
<!-- OPTIONS -->
0 commit comments