Vue Sankey - Overview

A tooltip is a small pop-up rectangle that displays information about a sankey node or link when it is hovered over or pressed.

Sankey Tooltip

Properties that configure tooltips are collected in the tooltip object. If you want to customize a specific tooltip, assign a function to the customizeNodeTooltip or customizeLinkTooltip property, depending on whether the tooltip belongs to a sankey node or link. This function should return a configuration object for the tooltip you want to customize.

App.vue
  • <template>
  • <DxSankey ... >
  • <DxTooltip
  • color="yellow"
  • :customize-node-tooltip="customizeNodeTooltip"
  • />
  • </DxSankey>
  • </template>
  •  
  • <script>
  • import DxSankey, { DxTooltip } from 'devextreme-vue/sankey';
  •  
  • export default {
  • components: {
  • DxSankey,
  • DxTooltip
  • },
  • methods: {
  • // Tooltips of all nodes with outgoing weight less than 1 turn red
  • // Other tooltips remain yellow
  • customizeNodeTooltip(nodeInfo) {
  • return nodeInfo.weightOut < 1 ? { color: "red" } : { }
  • }
  • }
  • }
  • </script>

View Demo

See Also