How to change the hover display content when the mouse is moved into the chart area ?
Question Description
After I move the mouse into a bar chart, the hovered bar will display a floating box showing the data information of the bar. I want to change the display content to other data content. How can I achieve this?
Solution
The information displayed after the graphic element in the chart is hovered is generally called tooltip. In VChart, developers can customize the title and the content displayed in each line through the configuration of the tooltip component. Tooltip includes two forms of interaction, one is the interaction of hover on the graphic element, and the other is the interaction of hover on the data dimension. These two interactions can be configured through tooltip.mark and tooltip.dimension.
In addition to customizing the display text of the tooltip, VChart also allows users to render arbitrary content through the tooltip handler, such as displaying an additional chart in the tooltip: