11<script setup>
22import { ref , computed , nextTick } from " vue" ;
3- import { makeDonut , palette , convertColorToHex , opacity , makeXls } from ' ../lib' ;
3+ import { makeDonut , palette , convertColorToHex , createUid , opacity , makeXls } from ' ../lib' ;
44import pdf from " ../pdf" ;
55import img from " ../img" ;
66import mainConfig from " ../default_configs.json" ;
7- import { useMouse } from " ../useMouse" ;
8- import { calcTooltipPosition } from " ../calcTooltipPosition" ;
97import Title from " ../atoms/Title.vue" ;
108import { useNestedProp } from " ../useNestedProp" ;
119import UserOptions from " ../atoms/UserOptions.vue" ;
1210import DataTable from " ../atoms/DataTable.vue" ;
11+ import Tooltip from " ../atoms/Tooltip.vue" ;
1312
1413const props = defineProps ({
1514 config: {
@@ -33,21 +32,11 @@ const defaultConfig = ref(mainConfig.vue_ui_donut);
3332const isPrinting = ref (false );
3433const isImaging = ref (false );
3534const donutChart = ref (null );
36- const tooltip = ref (null );
3735const details = ref (null );
38- const clientPosition = ref (useMouse ());
3936const isTooltip = ref (false );
4037const tooltipContent = ref (" " );
4138const selectedSerie = ref (null );
4239
43- const tooltipPosition = computed (() => {
44- return calcTooltipPosition ({
45- tooltip: tooltip .value ,
46- chart: donutChart .value ,
47- clientPosition: clientPosition .value
48- });
49- })
50-
5140const donutConfig = computed (() => {
5241 return useNestedProp ({
5342 userConfig: props .config ,
@@ -547,13 +536,12 @@ defineExpose({
547536 </div >
548537
549538 <!-- TOOLTIP -->
550- <div
551- data-cy =" donut-tooltip"
552- class =" vue-ui-donut-tooltip"
553- ref =" tooltip"
554- v-if =" donutConfig.style.chart.tooltip.show && isTooltip"
555- :style =" `top:${tooltipPosition.top}px;left:${tooltipPosition.left}px;background:${donutConfig.style.chart.tooltip.backgroundColor};color:${donutConfig.style.chart.tooltip.color}`"
556- v-html =" tooltipContent"
539+ <Tooltip
540+ :show =" donutConfig.style.chart.tooltip.show && isTooltip"
541+ :backgroundColor =" donutConfig.style.chart.tooltip.backgroundColor"
542+ :color =" donutConfig.style.chart.tooltip.color"
543+ :parent =" donutChart"
544+ :content =" tooltipContent"
557545 />
558546
559547 <!-- DATA TABLE -->
@@ -627,17 +615,6 @@ path {
627615 height : 24px ;
628616}
629617
630- /* * */
631- .vue-ui-donut-tooltip {
632- border : 1px solid #e1e5e8 ;
633- border-radius : 4px ;
634- box-shadow : 0 6px 12px -6px rgba (0 ,0 ,0 ,0.2 );
635- max-width : 300px ;
636- position : fixed ;
637- padding :12px ;
638- z-index :1 ;
639- }
640-
641618.vue-ui-dna * {
642619 animation : none !important ;
643620}
0 commit comments