1
1
<script setup>
2
2
import { ref , computed , nextTick } from " vue" ;
3
- import { makeDonut , palette , convertColorToHex , opacity , makeXls } from ' ../lib' ;
3
+ import { makeDonut , palette , convertColorToHex , createUid , opacity , makeXls } from ' ../lib' ;
4
4
import pdf from " ../pdf" ;
5
5
import img from " ../img" ;
6
6
import mainConfig from " ../default_configs.json" ;
7
- import { useMouse } from " ../useMouse" ;
8
- import { calcTooltipPosition } from " ../calcTooltipPosition" ;
9
7
import Title from " ../atoms/Title.vue" ;
10
8
import { useNestedProp } from " ../useNestedProp" ;
11
9
import UserOptions from " ../atoms/UserOptions.vue" ;
12
10
import DataTable from " ../atoms/DataTable.vue" ;
11
+ import Tooltip from " ../atoms/Tooltip.vue" ;
13
12
14
13
const props = defineProps ({
15
14
config: {
@@ -33,21 +32,11 @@ const defaultConfig = ref(mainConfig.vue_ui_donut);
33
32
const isPrinting = ref (false );
34
33
const isImaging = ref (false );
35
34
const donutChart = ref (null );
36
- const tooltip = ref (null );
37
35
const details = ref (null );
38
- const clientPosition = ref (useMouse ());
39
36
const isTooltip = ref (false );
40
37
const tooltipContent = ref (" " );
41
38
const selectedSerie = ref (null );
42
39
43
- const tooltipPosition = computed (() => {
44
- return calcTooltipPosition ({
45
- tooltip: tooltip .value ,
46
- chart: donutChart .value ,
47
- clientPosition: clientPosition .value
48
- });
49
- })
50
-
51
40
const donutConfig = computed (() => {
52
41
return useNestedProp ({
53
42
userConfig: props .config ,
@@ -547,13 +536,12 @@ defineExpose({
547
536
</div >
548
537
549
538
<!-- 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"
557
545
/>
558
546
559
547
<!-- DATA TABLE -->
@@ -627,17 +615,6 @@ path {
627
615
height : 24px ;
628
616
}
629
617
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
-
641
618
.vue-ui-dna * {
642
619
animation : none !important ;
643
620
}
0 commit comments