Class StockChartTooltipSettings
To specify customization options for stock chart tooltip.
Inheritance
Inherited Members
Namespace: Syncfusion.Blazor.Charts
Assembly: Syncfusion.Blazor.dll
Syntax
public class StockChartTooltipSettings : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Constructors
StockChartTooltipSettings()
Declaration
public StockChartTooltipSettings()
Properties
Duration
Duration for the ToolTip animation.
Declaration
[Parameter]
public double Duration { get; set; }
Property Value
| Type |
|---|
| double |
Enable
Enables / Disables the visibility of the tooltip.
Declaration
[Parameter]
public bool Enable { get; set; }
Property Value
| Type |
|---|
| bool |
EnableAnimation
If set to true, ToolTip will animate while moving from one point to another.
Declaration
[Parameter]
public bool EnableAnimation { get; set; }
Property Value
| Type |
|---|
| bool |
EnableMarker
Enables / Disables the visibility of the marker.
Declaration
[Parameter]
public bool EnableMarker { get; set; }
Property Value
| Type |
|---|
| bool |
EnableTextWrap
To wrap the tooltip long text based on available space. This is only application for chart tooltip.
Declaration
[Parameter]
public bool EnableTextWrap { get; set; }
Property Value
| Type |
|---|
| bool |
FadeOutDuration
Fade Out duration for the ToolTip hide.
Declaration
[Parameter]
public double FadeOutDuration { get; set; }
Property Value
| Type |
|---|
| double |
Fill
The fill color of the tooltip that accepts value in hex and rgba as a valid CSS color string.
Declaration
[Parameter]
public string Fill { get; set; }
Property Value
| Type |
|---|
| string |
Format
Format the ToolTip content.
Declaration
[Parameter]
public string Format { get; set; }
Property Value
| Type |
|---|
| string |
Header
Header for tooltip.
Declaration
[Parameter]
public string Header { get; set; }
Property Value
| Type |
|---|
| string |
Opacity
The fill color of the tooltip that accepts value in hex and rgba as a valid CSS color string.
Declaration
[Parameter]
public double? Opacity { get; set; }
Property Value
| Type |
|---|
| double? |
Shared
If set to true, a single ToolTip will be displayed for every index.
Declaration
[Parameter]
public bool Shared { get; set; }
Property Value
| Type |
|---|
| bool |
ShowHeaderLine
Gets or sets a value that determines whether the header line is displayed in the tooltip.
Declaration
[Parameter]
public bool ShowHeaderLine { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | true to display the tooltip header line; otherwise, false. The default value is true. |
Remarks
This property controls the display of the header line in the tooltip.
ShowNearestTooltip
Gets or sets a value that determines whether tooltips are displayed for the nearest data point to the cursor.
Declaration
[Parameter]
public bool ShowNearestTooltip { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | true to display the tooltip for the nearest data point to the cursor; otherwise, false. The default value is false. |
Remarks
This property controls the display of the tooltip based on the proximity of the nearest data point to the cursor.
Template
Custom template to format the ToolTip content. Use ${x} and ${y} as the placeholder text to display the corresponding data point.
Declaration
[Parameter]
public RenderFragment<object> Template { get; set; }
Property Value
| Type |
|---|
| RenderFragment<object> |
TooltipPosition
Gets and sets the tooltip position for the StockChart. The available modes are,
- Fixed The StockChart tooltip will be placed in the fixed position.
- Nearest The StockChart tooltip moves along with the mouse.
Declaration
[Parameter]
public TooltipPosition TooltipPosition { get; set; }
Property Value
| Type | Description |
|---|---|
| TooltipPosition | Customize the StockChart tooltip position. The default value is Fixed. |
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTreeBuilder | __builder |
Overrides
SetTooltipOpacity(Theme)
Sets the default tooltip opacity based on the specified Theme when no value is provided for the Opacity property.
Declaration
protected void SetTooltipOpacity(Theme theme)
Parameters
| Type | Name | Description |
|---|---|---|
| Theme | theme | The Theme applied to the parent SfStockChart, used to determine the appropriate default opacity level. |
Remarks
If the Opacity property is null, this method assigns
a theme‑specific default opacity. Fluent2, Fluent2Dark, Fluent2HighContrast, and Bootstrap5
themes apply an opacity value of 1, while all other themes default to 0.75.
This method is automatically invoked during component initialization and does not need to be called manually in normal usage.
Examples
The following example illustrates how tooltip opacity is assigned based on the chart theme:
// When theme is Fluent2, Opacity becomes 1
tooltipSettings.SetTooltipOpacity(Theme.Fluent2);
// When theme is Material, Opacity becomes 0.75
tooltipSettings.SetTooltipOpacity(Theme.Material);