Skip to content

Commit b940cac

Browse files
committed
Make tooltips headless in customFormat mode
1 parent f4df6f4 commit b940cac

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-data-ui",
33
"private": false,
4-
"version": "2.0.7",
4+
"version": "2.0.8",
55
"type": "module",
66
"description": "A user-empowering data visualization Vue components library",
77
"keywords": [

src/App.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,12 +2319,12 @@ const donutConfig = ref({
23192319
23202320
const xyConfig = ref({
23212321
chart: {
2322-
tooltip: {
2323-
customFormat: ({ seriesIndex, datapoint, series, bars, lines, plots, config }) => {
2324-
console.log({seriesIndex, datapoint, series, bars, lines, plots, config});
2325-
return 'TEST'
2326-
}
2327-
}
2322+
// tooltip: {
2323+
// customFormat: ({ seriesIndex, datapoint, series, bars, lines, plots, config }) => {
2324+
// console.log({seriesIndex, datapoint, series, bars, lines, plots, config});
2325+
// return 'TEST'
2326+
// }
2327+
// }
23282328
}
23292329
})
23302330

src/atoms/Tooltip.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ const position = computed(() => {
5050
data-cy="tooltip"
5151
:class="{'vue-data-ui-custom-tooltip' : isCustom, 'vue-data-ui-tooltip': !isCustom}"
5252
v-if="show"
53-
:style="`top:${position.top}px;left:${position.left}px;${isCustom ? '' : `background:${props.backgroundColor};color:${props.color};max-width:${props.maxWidth}`}`"
53+
:style="`top:${position.top}px;left:${position.left}px;${props.isCustom ? '' : `background:${props.backgroundColor};color:${props.color};max-width:${props.maxWidth}`}`"
5454
>
5555
<slot/>
5656
<div v-html="content"/>
5757
<slot name="content-after"/>
5858
</div>
5959
</template>
6060

61-
<style scoped>
61+
<style>
6262
.vue-data-ui-tooltip {
6363
border: 1px solid #e1e5e8;
6464
border-radius: 4px;
@@ -67,9 +67,6 @@ const position = computed(() => {
6767
padding:12px;
6868
z-index:2;
6969
}
70-
</style>
71-
72-
<style>
7370
.vue-data-ui-custom-tooltip {
7471
position: fixed;
7572
z-index: 2;

0 commit comments

Comments
 (0)