ClassChartTooltip
Configures interactive tooltips that appear when users hover over chart data points. Provides contextual information, data values, and formatted details for enhanced user experience. Essential for making charts interactive and informative without cluttering the visualization. Supports custom templates, shared tooltips across series, and advanced formatting options. Use to display detailed data values, percentages, dates, and custom contextual information.
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Syntax:
public class ChartTooltip : ChartTooltipBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseDataVizChildComponentChartSeriesTooltipBaseChartTooltipBaseChartTooltip
Implements:
Inherited Members
Constructors
ChartTooltip()
Declaration
public ChartTooltip()
Properties
AutoHide
Controls whether the chart tooltip automatically hides when the mouse leaves the target chart element. When set to true, the tooltip disappears automatically on mouse leave. When false, a close button is displayed within the tooltip for manual dismissal. Use this to control tooltip behavior based on user interaction preferences and chart complexity. Example: Set to false for complex tooltips with interactive content that users may need time to read or interact with.
Background
Sets the background color of the chart tooltip container. Accepts any valid CSS color value including hex codes (#f8f9fa), RGB values (rgb(248,249,250)), or color names (lightgray). Use this to match tooltip styling with your application theme and ensure proper contrast for tooltip content readability. Example: Set to "rgba(255,255,255,0.95)" for a semi-transparent white background that doesn't completely obscure chart data.
Declaration
[Parameter]
public string Background { get; set; }
Property Value
ChildContent
Declaration
[Parameter]
public RenderFragment ChildContent { get; set; }
Property Value
Color
Sets the text color for all content within the chart tooltip. Accepts any valid CSS color value including hex codes (#333333), RGB values (rgb(51,51,51)), or color names (black). Use this to ensure tooltip text has appropriate contrast against the background and maintains readability across different themes. Example: Set to "#ffffff" when using dark tooltip backgrounds, or "#2c3e50" for professional dark text on light backgrounds.
Font
Sets the font properties for tooltip text using CSS font syntax. Accepts standard CSS font shorthand notation including font-weight, font-size, and font-family specifications. Use this to ensure tooltip typography matches your application's design system and maintains consistency with other UI elements. Example: Set to "12px Arial" for compact tooltips, or "bold 14px 'Segoe UI'" for more prominent tooltip displays.
Opacity
Sets the transparency level of the entire tooltip container. Accepts values between 0 (completely transparent) and 1 (completely opaque) to control tooltip visibility. Use this to create subtle tooltip presentations that don't completely obscure underlying chart data while maintaining readability. Example: Set to 0.9 for slightly transparent tooltips, or 0.8 for more transparency when overlaying dense chart areas.
Declaration
[Parameter]
public double? Opacity { get; set; }
Property Value
Visible
Controls whether tooltips are displayed when users hover over chart elements. When set to true, tooltips appear on hover to show additional data context. When false, no tooltips are shown. Use this to enable or disable the tooltip feature based on chart complexity, user preferences, or display requirements. Example: Set to true for data-rich charts where users need detailed hover information, or false for simple charts where tooltips might be distracting.
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
Overrides
OnAfterRender(bool)
Declaration
protected override void OnAfterRender(bool firstRender)
Parameters
firstRender
Overrides
OnInitialized()
Declaration
protected override void OnInitialized()
Overrides
OnParametersSet()
Declaration
protected override void OnParametersSet()
Overrides
Serialize()
Declaration
public Dictionary<string, object> Serialize()
Returns