Class Gradient
Gradient allows you to define and apply the gradient effect to the node.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.JavaScript.DataVisualization.Models.Diagram
Assembly: Syncfusion.EJ.dll
Syntax
public class Gradient : EJTagHelper
Constructors
Gradient()
Declaration
public Gradient()
Properties
Stops
Gets or sets the different colors and the region of color transitions
Declaration
[JsonProperty("stops")]
public Collection Stops { get; set; }
Property Value
Type | Description |
---|---|
Collection | Collection |
Examples
Node Node = new Node();
Node.Name = "node";
Node.Width = 100;
Node.Height = 100;
Collection Stops = new Collection();
Stops.Add(new Stop() { Color = "white", Offset = 0 });
Stops.Add(new Stop() { Color = "red", Offset = 50 });
Node.Gradient = new LinearGradient() { X1 = 0, X2 = 50, Y1 = 0, Y2 = 50, Stops = Stops };
Model.Nodes.Add(Node);
Type
Gets or sets the type of the gradient to be applied.
Declaration
[JsonProperty("type")]
public virtual string Type { get; set; }
Property Value
Type | Description |
---|---|
System.String | "linear" |
Examples
// Apply the fill color for the node
LinearGradient Gradient = new LinearGradient() { Type ="linear" };
Gradient.Stops.Add(new Stop() { Color = "red" });
Gradient.Stops.Add(new Stop() { Color = "pink" });
Node Node = new Node() { Gradient = Gradient };
X1
Declaration
[Obsolete("Use LinearGradient.X1")]
public double X1 { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
X2
Declaration
[Obsolete("Use LinearGradient.X2")]
public double X2 { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Y1
Declaration
[Obsolete("Use LinearGradient.Y1")]
public double Y1 { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Y2
Declaration
[Obsolete("Use LinearGradient.Y2")]
public double Y2 { get; set; }
Property Value
Type | Description |
---|---|
System.Double |