Class SankeyTitleStyle
Gets or sets the options for customizing the title of the SfSankey.
Inheritance
Namespace: Syncfusion.Blazor.Sankey
Assembly: Syncfusion.Blazor.dll
Syntax
public class SankeyTitleStyle : SankeyComponentBase
Remarks
Use this class to customize the font style, size, weight, and position of the title in the SfSankey. Based on the SfSankey theme, the title font style will be applied.
Examples
<SfSankey Width="600px" Height="400px" DataSource="@SankeyData"Title="Device Usage" SubTitle="-2023">
<SankeyTitleStyle FontSize="16px" FontFamily="Roboto" FontWeight="800"></SankeyTitleStyle>
<SankeySubtitleStyle FontSize="10px" FontFamily="Roboto" FontWeight="400"></SankeySubtitleStyle>
<SankeyNodes Width="30" Alignment="SankeyNodeAlign.Left" Offset="10" Padding="10">
</SankeyNodes>
<SankeyLinks Color="blue" ColorType="ColorType.Source" HighlightOpacity="1" InactiveOpacity="0.3" Opacity="0.7"> </SankeyLinks>
<SankeyLabels Visible="true" FontSize="12" Color="black" FontFamily="Arial" FontWeight="400" Padding="8"></SankeyLabels>
<SankeyMargin Left="10" Right="10" Top="10" Bottom="10"></SankeyMargin>
</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
SankeyTitleStyle()
Declaration
public SankeyTitleStyle()
Properties
Color
Gets or sets the color of the title text.
Declaration
public string Color { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string value specifying the color of the title text. The default value is null. |
Remarks
When the value is null, the title text color is automatically determined based on the Theme.
FontFamily
Gets or sets the font family of the Sankey title.
Declaration
public string FontFamily { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the font family of the Sankey title. The default font family is determined by the Sankey's theme. By default, the theme is set to Material with the font family Roboto. |
Remarks
This property allows customization of the font family for the Sankey title, providing flexibility in text appearance and style.
FontSize
Gets or sets the font size of the Sankey title.
Declaration
public string FontSize { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the font size of the Sankey title. The default title font size is 16px. |
Remarks
This property allows customization of the font size for the Sankey title, providing flexibility in design and presentation.
FontStyle
Gets or sets the font style of the Sankey title.
Declaration
public string FontStyle { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the font style of the Sankey title. Options include 'normal', 'italic', or 'oblique'. The default style is 'normal'. |
Remarks
This property allows customization of the font style for the Sankey title, providing flexibility in text presentation and emphasis.
FontWeight
Gets or sets the font weight of the Sankey title.
Declaration
public string FontWeight { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the font weight of the Sankey title. The default font weight is determined by the Sankey's theme. By default, the theme is set to Material with a font weight of 600. |
Remarks
This property allows customization of the font weight for the Sankey title, providing flexibility in text styling and emphasis.
Methods
GetFontKey()
Constructs a unique key for the font by concatenating the font properties.
Declaration
public string GetFontKey()
Returns
Type | Description |
---|---|
System.String | A string that represents the unique key for the font used in the chart title. |
GetTextStyle()
Declaration
public ISankeyThemeTextStyle GetTextStyle()
Returns
Type |
---|
Syncfusion.Blazor.Sankey.Internal.ISankeyThemeTextStyle |