menu

ASP.NET Web Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class LinearGradient

    Show / Hide Table of Contents

    Class LinearGradient

    Defines a smooth transition between a set of colors (so-called “stops”) on a line.

    Inheritance
    System.Object
    EJTagHelper
    Gradient
    LinearGradient
    Inherited Members
    Gradient.Stops
    EJTagHelper.GetControlDetails()
    EJTagHelper.GetControlDetails(String)
    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 LinearGradient : Gradient

    Constructors

    LinearGradient()

    Initializes a new instance of the LinearGradient class.

    Declaration
    public LinearGradient()

    LinearGradient(LinearGradient)

    Initializes a new instance of the LinearGradient class.

    Declaration
    public LinearGradient(LinearGradient src)
    Parameters
    Type Name Description
    LinearGradient src

    Object to copy.

    Properties

    Type

    Gets or sets the type of the gradient to be applied.

    Declaration
    [JsonProperty("type")]
    public override string Type { get; }
    Property Value
    Type Description
    System.String

    "linear"

    Overrides
    Gradient.Type
    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

    Gets or sets the left most position(relative to node) of the rectangular region that needs to be painted

    Declaration
    [JsonProperty("x1")]
    public double X1 { get; set; }
    Property Value
    Type Description
    System.Double

    0

    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);

    X2

    Gets or sets the right most position(relative to node) of the rectangular region that needs to be painted

    Declaration
    [JsonProperty("x2")]
    public double X2 { get; set; }
    Property Value
    Type Description
    System.Double

    0

    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);

    Y1

    Gets or sets the top most position(relative to node) of the rectangular region that needs to be painted

    Declaration
    [JsonProperty("y1")]
    public double Y1 { get; set; }
    Property Value
    Type Description
    System.Double

    0

    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);

    Y2

    Gets or sets the bottom most position(relative to node) of the rectangular region that needs to be painted

    Declaration
    [JsonProperty("y2")]
    public double Y2 { get; set; }
    Property Value
    Type Description
    System.Double

    0

    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);

    Methods

    Clone()

    Creates a new object that is a copy of the current instance.

    Declaration
    public object Clone()
    Returns
    Type Description
    System.Object

    Copy of the object this method is invoked against.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved