I have a sankey diagram that shows moving products within campaigns, data is correct and also the sankey diagram itself is showing correct movements and counts.
The problem is the tooltip, which is showing fromNode and toNode wrongly, leading to a tooltip showing make up mid score → make up high score: 96, but it should be the other way round.
The data used in the background for this is correct and in the correct order: source, target, weight. But also changing it did not change anything, so this seems not to be the problem
I tried to change the logic of the tooltip within the chart config editor. According to the highcharts documentation you should be able to manipulate the tooltip with the pointFormat and nodeFormat configuration.
Unfortunately they do not work with my code:
"pointFormat": "{point.fromNode.name} --> {point.toNode.name}: {point.weight}",
"nodeFormat": "{point.name}: {point.sum}"
It does not take this at all into consideration and falls back to the “standard” way which is the one described above which is in the wrong order.
The only thing working is the format configuration, but this leads to wrong behaviour of the node formatting, because if you provide a general tooltip.format, Highcharts tries to apply it to everything you hover over. When you hover over a node, it doesn’t have point.fromNode.name or point.toNode.name, which is why you’re seeing the literal “–>” and incorrect formatting for the nodes.
So i tried the formatter option, which should give me the possibility to distinguish between node and point formatting within the function provided.
"formatter": "function() { if (this.point.fromNode) { return this.point.fromNode.name + ' \u2192 ' + this.point.toNode.name + ': ' + this.point.weight; } else if (this.point.isNode) { return this.point.name + ': ' + this.point.sum; } else { return 'Hover point (type unknown)'; } }",
When hovering over the sankey I do not get a tooltip at all but errors in the console of my browser:
Uncaught TypeError: p.call is not a function
at P.refresh (vendors-node_modules_styled-icons_material-outlined_ErrorOutline_ErrorOutline_esm_js-node_mod-f026d9-85f32d1266767820e8da.chunk.js:1:217967)
at P.<anonymous> (vendors-node_modules_styled-icons_material-outlined_ErrorOutline_ErrorOutline_esm_js-node_mod-f026d9-85f32d1266767820e8da.chunk.js:1:106580)
at P.<anonymous> (src_visualizations_components_Highcharts_HighchartsVisualization_tsx-a7ff88ad8296ac78065e.chunk.js:1:26167)
at t.<computed> (vendors-node_modules_styled-icons_material-outlined_ErrorOutline_ErrorOutline_esm_js-node_mod-f026d9-85f32d1266767820e8da.chunk.js:1:106548)
at n.<anonymous> (vendors-node_modules_styled-icons_material-outlined_ErrorOutline_ErrorOutline_esm_js-node_mod-f026d9-85f32d1266767820e8da.chunk.js:1:243739)
at S (vendors-node_modules_styled-icons_material-outlined_ErrorOutline_ErrorOutline_esm_js-node_mod-f026d9-85f32d1266767820e8da.chunk.js:1:100698)
at n.firePointEvent (vendors-node_modules_styled-icons_material-outlined_ErrorOutline_ErrorOutline_esm_js-node_mod-f026d9-85f32d1266767820e8da.chunk.js:1:226099)
at C.runPointActions (vendors-node_modules_styled-icons_material-outlined_ErrorOutline_ErrorOutline_esm_js-node_mod-f026d9-85f32d1266767820e8da.chunk.js:1:243691)
at n.onMouseOver (vendors-node_modules_styled-icons_material-outlined_ErrorOutline_ErrorOutline_esm_js-node_mod-f026d9-85f32d1266767820e8da.chunk.js:1:230801)
at n.<anonymous> (vendors-node_modules_styled-icons_material-outlined_ErrorOutline_ErrorOutline_esm_js-node_mod-f026d9-85f32d1266767820e8da.chunk.js:1:106580)
What could be the issue and how can I solve it?
