Overview
Tooltips in amCharts 5 display contextual information when users hover over or interact with chart elements. TheTooltip class extends Container and provides a pointing mechanism, automatic positioning, and rich content formatting.
Basic Tooltips
Adding a Tooltip to a Series
/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:158-623
Tooltip on Individual Elements
Tooltip Content
Text Content
Set tooltip text usinglabelText:
/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:28-31
HTML Content (v5.2.11+)
Use HTML for rich formatting:/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:33-38
Data Placeholders
Use curly braces to insert data values:Tooltip Appearance
Colors
Get Fill from Target
Make tooltip background match the hovered element:/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:61-67
Custom Colors
/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:347-442
Auto Text Color
Automatically adjust text color for contrast:/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:100-105
Pointer Orientation
Control which direction the tooltip pointer faces:/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:54-58
Tooltip Positioning
Point To Location
Manually position the tooltip:/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:108-111
Bounds
Constrain tooltip within specific bounds:/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:95-98
Animation
Animation Duration
Control how fast the tooltip moves:/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:113-117
Animation Easing
/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:119-123
Advanced Features
Keep Target Hovered
Keep the target element highlighted when hovering over tooltip (v5.2.14+):/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:131-137
Screen Reader Announcements (v5.9.2+)
Enable automatic screen reader announcements:/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:140-146
Accessing Tooltip Elements
Tooltip Label
/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:240-247
Tooltip Background
/home/daytona/workspace/source/src/.internal/core/render/Tooltip.ts:185-204
Shared Tooltips
Multiple Series Tooltip
Show data from multiple series in one tooltip:Conditional Tooltips
Show/Hide Based on Data
Dynamic Tooltip Content
Tooltip Events
Manually Show/Hide
Styling Examples
Modern Tooltip Style
Minimal Tooltip Style
Best Practices
Keep Content Concise
Keep Content Concise
Show only the most relevant information:
Use Appropriate Colors
Use Appropriate Colors
Ensure sufficient contrast for readability:
Consider Mobile Users
Consider Mobile Users
Ensure tooltips work well on touch devices:
Format Numbers Appropriately
Format Numbers Appropriately
Use number formatters in tooltip text:
Optimize Performance
Optimize Performance
Reuse tooltip instances when possible:
Common Patterns
Percentage Tooltip
Date Formatting Tooltip
Multi-Line Tooltip
Related
Labels
Learn about text formatting and styling
Colors
Customize tooltip colors and backgrounds