Class GradientType
Specifies the type of transition between two or more colors.
Inheritance
System.Object
GradientType
Namespace: Syncfusion.Blazor.Diagrams
Assembly: Syncfusion.Blazor.dll
Syntax
public sealed class GradientType : Enum
Remarks
To know more about using Gradient type, refer to these links |
1. NodesAppearance |
2. DiagramGradient |
Examples
<SfDiagram Height="600px" Nodes="@NodeCollection">
</SfDiagram>
@code{
public ObservableCollection<DiagramNode> NodeCollection = new ObservableCollection<DiagramNode>() { };
protected override void OnInitialized()
{
// A node is created and stored in nodes array.
DiagramNode node1 = new DiagramNode()
{
// Position of the node
OffsetX = 250,
OffsetY = 250,
// Size of the node
Width = 100,
Height = 100,
Style = new NodeShapeStyle()
{
Gradient = new DiagramGradient()
{
//Start point of linear gradient
X1 = 0,
Y1 = 0,
//End point of linear gradient
X2 = 50,
Y2 = 50,
//Sets an array of stop objects
Stops = new ObservableCollection<DiagramsGradientStop>()
{
new DiagramsGradientStop(){ Color = "white", Offset = 0},
new DiagramsGradientStop(){ Color = "#6BA5D7", Offset = 100}
},
Type = GradientType.Linear
}
},
};
NodeCollection.Add(node1);
}
}
Fields
Linear
Sets the type of gradient as Linear.
Declaration
public const GradientType Linear
Field Value
Type | Description |
---|---|
GradientType |
None
No gradient will be applied by default.
Declaration
public const GradientType None
Field Value
Type | Description |
---|---|
GradientType |
Radial
Sets the type of gradient as Radial.
Declaration
public const GradientType Radial
Field Value
Type | Description |
---|---|
GradientType |
value__
Declaration
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |