Skip to content

Commit

Permalink
Make tooltips headless in customFormat mode
Browse files Browse the repository at this point in the history
  • Loading branch information
graphieros committed Mar 7, 2024
1 parent f4df6f4 commit b940cac
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-data-ui",
"private": false,
"version": "2.0.7",
"version": "2.0.8",
"type": "module",
"description": "A user-empowering data visualization Vue components library",
"keywords": [
Expand Down
12 changes: 6 additions & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2319,12 +2319,12 @@ const donutConfig = ref({
const xyConfig = ref({
chart: {
tooltip: {
customFormat: ({ seriesIndex, datapoint, series, bars, lines, plots, config }) => {
console.log({seriesIndex, datapoint, series, bars, lines, plots, config});
return 'TEST'
}
}
// tooltip: {
// customFormat: ({ seriesIndex, datapoint, series, bars, lines, plots, config }) => {
// console.log({seriesIndex, datapoint, series, bars, lines, plots, config});
// return 'TEST'
// }
// }
}
})
Expand Down
7 changes: 2 additions & 5 deletions src/atoms/Tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ const position = computed(() => {
data-cy="tooltip"
:class="{'vue-data-ui-custom-tooltip' : isCustom, 'vue-data-ui-tooltip': !isCustom}"
v-if="show"
:style="`top:${position.top}px;left:${position.left}px;${isCustom ? '' : `background:${props.backgroundColor};color:${props.color};max-width:${props.maxWidth}`}`"
:style="`top:${position.top}px;left:${position.left}px;${props.isCustom ? '' : `background:${props.backgroundColor};color:${props.color};max-width:${props.maxWidth}`}`"
>
<slot/>
<div v-html="content"/>
<slot name="content-after"/>
</div>
</template>

<style scoped>
<style>
.vue-data-ui-tooltip {
border: 1px solid #e1e5e8;
border-radius: 4px;
Expand All @@ -67,9 +67,6 @@ const position = computed(() => {
padding:12px;
z-index:2;
}
</style>

<style>
.vue-data-ui-custom-tooltip {
position: fixed;
z-index: 2;
Expand Down

0 comments on commit b940cac

Please sign in to comment.