Class SankeyTooltipTextStyle
Gets or sets the font style customization for the respective SfSankey element.
Inheritance
Namespace: Syncfusion.Blazor.Sankey
Assembly: Syncfusion.Blazor.dll
Syntax
public class SankeyTooltipTextStyle : SankeyComponentBase, ISankeyFontStyle
Remarks
This is base class for all the font style customization classes in the SfSankey. Using this class, we can customize the font size, family, style, weight, color, and opacity of the text in the SfSankey.
Examples
<SfSankey Width="600px" Height="400px" DataSource="@SankeyData"Title="Device Usage" SubTitle="-2023">
<SankeyTooltipSettings Enable="true" Fill="blue" Opacity="0.7">
<SankeyTooltipTextStyle Color="White" FontSize="10px" FontFamily="Roboto" FontWeight="400" FontStyle="italic"></SankeyTooltipTextStyle>
</SankeyTooltipSettings>
</SfSankey>
@code {
public SankeyData SankeyData = new SankeyData()
{
Nodes = new List<SankeyDataNode>(),
Links = new List<SankeyDataLink>()
};
protected override void OnInitialized()
{
base.OnInitialized();
SankeyData.Nodes = new List<SankeyDataNode>()
{
new SankeyDataNode() { Id = "Female", Label = new SankeyDataLabel() { Text = "Female (58%)" } },
new SankeyDataNode() { Id = "Male", Label = new SankeyDataLabel() { Text = "Male (42%)" } },
new SankeyDataNode() { Id = "Tablet", Label = new SankeyDataLabel() { Text = "Tablet (12%)" } },
new SankeyDataNode() { Id = "Mobile", Label = new SankeyDataLabel() { Text = "Mobile (40%)" } },
new SankeyDataNode() { Id = "Desktop", Label = new SankeyDataLabel() { Text = "Desktop (48%)" } },
new SankeyDataNode() { Id = "< 18", Label = new SankeyDataLabel() { Text = "< 18 years (8%)" } },
new SankeyDataNode() { Id = "18-26", Label = new SankeyDataLabel() { Text = "18-26 years (35%)" } },
new SankeyDataNode() { Id = "27-40", Label = new SankeyDataLabel() { Text = "27-40 years (38%)" } },
new SankeyDataNode() { Id = "> 40", Label = new SankeyDataLabel() { Text = "> 40 years (19%)" } }
};
SankeyData.Links = new List<SankeyDataLink>()
{
new SankeyDataLink() { SourceId = "Female", TargetId = "Tablet", Value = 12 },
new SankeyDataLink() { SourceId = "Female", TargetId = "Mobile", Value = 14 },
new SankeyDataLink() { SourceId = "Female", TargetId = "Desktop", Value = 32 },
new SankeyDataLink() { SourceId = "Male", TargetId = "Mobile", Value = 26 },
new SankeyDataLink() { SourceId = "Male", TargetId = "Desktop", Value = 16 },
new SankeyDataLink() { SourceId = "Tablet", TargetId = "< 18", Value = 4 },
new SankeyDataLink() { SourceId = "Tablet", TargetId = "> 40", Value = 8 },
new SankeyDataLink() { SourceId = "Mobile", TargetId = "< 18", Value = 4 },
new SankeyDataLink() { SourceId = "Mobile", TargetId = "18-26", Value = 24 },
new SankeyDataLink() { SourceId = "Mobile", TargetId = "27-40", Value = 10 },
new SankeyDataLink() { SourceId = "Mobile", TargetId = "> 40", Value = 2 },
new SankeyDataLink() { SourceId = "Desktop", TargetId = "18-26", Value = 11 },
new SankeyDataLink() { SourceId = "Desktop", TargetId = "27-40", Value = 28 },
new SankeyDataLink() { SourceId = "Desktop", TargetId = "> 40", Value = 9 }
};
}
}
Constructors
SankeyTooltipTextStyle()
Declaration
public SankeyTooltipTextStyle()
Properties
Color
Gets or sets the color for the text.
Declaration
public string Color { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the color for the text. The default value is null. |
Remarks
Accepts values in hex and rgba as a valid CSS color string.
FontFamily
Gets or sets the font family for the text.
Declaration
public string FontFamily { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the font family for the text. The default value is null. |
Remarks
If no font family is specified, based on the SfSankey theme the font family will be applied to the text.
FontSize
Gets or sets the font size for the text.
Declaration
public string FontSize { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the font size for the text. The default value is null. |
Remarks
If no font size is specified, based on the SfSankey theme the font size will be applied to the text.
FontStyle
Gets or sets the font style for the text.
Declaration
public string FontStyle { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the font style for the text. The default value is null. |
Remarks
If no font style is specified, based on the SfSankey theme the font style will be applied to the text.
FontWeight
Gets or sets the font weight for the text.
Declaration
public string FontWeight { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the font weight for the text. The default value is null. |
Remarks
If no font weight is specified, based on the SfSankey theme the font weight will be applied to the text.
Opacity
Gets or sets the opacity for the text.
Declaration
public double Opacity { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A double value representing the opacity for the text. It ranges from 0 to 1. The default value is 1. |
Remarks
Set this property to customize the opacity of the text in the SfSankey. It accepts values from 0 to 1.
Methods
GetFontKey()
Declaration
public string GetFontKey()
Returns
Type |
---|
System.String |
GetTextStyle()
Declaration
public ISankeyThemeTextStyle GetTextStyle()
Returns
Type |
---|
Syncfusion.Blazor.Sankey.Internal.ISankeyThemeTextStyle |