Class ChartCategory
Options to customize the category for the multilevel labels.
Inherited Members
Namespace: Syncfusion.Blazor.Charts
Assembly: Syncfusion.Blazor.dll
Syntax
public class ChartCategory : ChartSubComponent, ISubcomponentTracker
Constructors
ChartCategory()
Declaration
public ChartCategory()
Properties
CustomAttributes
Gets or sets the custom attributes for multi-level labels.
Declaration
public object CustomAttributes { get; set; }
Property Value
Type | Description |
---|---|
System.Object | An object that represents custom attributes for multi-labels. |
Remarks
The provided custom attribute can be accessed by the user from the OnAxisMultiLevelLabelRender event arguments for further actions/modifications.
Examples
This example demonstrates how to modify the text style of multi-level label using custom attributes from 'OnAxisMultiLevelLabelRender' event.
<SfChart>
<ChartEvents OnAxisMultiLevelLabelRender="OnMultiLevelLabelRender"></ChartEvents>
<ChartMultiLevelLabels>
<ChartMultiLevelLabel>
<ChartCategories>
<ChartCategory Start="-0.5" End="3.5" Text="Half yearly 1" MaximumTextWidth=50 CustomAttributes="@customAtt"></ChartCategory>
<ChartCategory Start="3.5" End="7.5" Text="Half yearly 2" MaximumTextWidth=50></ChartCategory>
</ChartCategories>
</ChartMultiLevelLabel>
</ChartMultiLevelLabels>
...
</SfChart>
@code {
object customAtt = new ChartAxisMultiLevelLabelTextStyle
{
FontFamily = "Roboto",
FontWeight = "600",
Color = "Red",
Size = "14px"
};
public void OnMultiLevelLabelRender(AxisMultiLabelRenderEventArgs args)
{
if (args.CustomAttributes != null)
{
args.TextStyle = (ChartAxisMultiLevelLabelTextStyle)args.CustomAttributes;
}
}
}
End
Gets or sets the end value of the multi-level label.
Declaration
public object End { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The end value of the multi-level label. |
MaximumTextWidth
Gets or sets the maximum width of the text for multi-level labels.
Declaration
public double MaximumTextWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The maximum width of the text for multi-level labels. The default value is 0. |
Remarks
If the text exceeds this value, it will be handled based on the multi-level labels "TextOverflow" option applied.
Start
Gets or sets the start value of the multi-level labels.
Declaration
public object Start { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The start value of the multi-level labels. |
Text
Gets or sets the text for the multi-level labels.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the text for the multi-level labels. The default value is an empty string. |
Type
Gets or sets the border type for the individual multi-level label.
Declaration
public BorderType Type { get; set; }
Property Value
Type | Description |
---|---|
BorderType | One of the BorderType enumerations that specifies the border type for the individual multi-level label. The options include:
|
Remarks
The multi-level label for this specific category will be rendered with the applied border type.
Methods
OnInitialized()
Declaration
protected override void OnInitialized()
OnParametersSet()
Declaration
protected override void OnParametersSet()