!!!###!!!title=27-How to customize the mounting node of the tooltip component in VChart——VisActor/VChart FAQ documents!!!###!!!

How to customize the mounting node of the tooltip component in VChart?

Question Description

Does VChart's tooltip support changing the mount node? For example, hanging in a chart container or elsewhere?

Solution

VChart's tooltip spec has a dedicated configuration item called parentElement, which supports passing in HTMLElement objects or strings (representing node ids) to meet the requirements. The following is an example of mounting tooltip to a chart container:

Code Example

Result

Quote

github:https://github.com/VisActor/VChart

option docs: https://www.visactor.io/vchart/option/barChart#tooltip.parentElement