New to Telerik UI for ASP.NET MVC? Download free 30-day trial

DiagramShapeDefaultsFillGradientSettingsBuilder

Methods

Type(System.String)

Defines the type of the gradient. The supported values are "linear" and "radial".

Parameters

value - System.String

The value that configures the type.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Fill(f => f.Gradient(g => g.Type("radial")))
               )
             )

Center(System.Double[])

Defines the center of the radial gradient. The coordinates are relative to the shape bounding box. For example [0, 0] is top left and [1, 1] is bottom right.

Parameters

value - System.Double[]

The value that configures the center point.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Fill(f => f.Gradient(g => g.Center(new double[] { 0.5, 0.5 })))
               )
             )

Radius(System.Double)

Defines the radius of the radial gradient relative to the shape bounding box.

Parameters

value - System.Double

The value that configures the radius.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Fill(f => f.Gradient(g => g.Radius(0.9)))
               )
             )

Start(System.Double[])

Defines the start point of the linear gradient. The coordinates are relative to the shape bounding box. For example [0, 0] is top left and [1, 1] is bottom right.

Parameters

value - System.Double[]

The value that configures the start point.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Fill(f => f.Gradient(g => g.Start(new double[] { 0.0, 0.3 })))
               )
             )

End(System.Double[])

Defines the end point of the linear gradient. The coordinates are relative to the shape bounding box. For example [0, 0] is top left and [1, 1] is bottom right.

Parameters

value - System.Double[]

The value that configures the end point.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Fill(f => f.Gradient(g => g.End(new double[] { 0.8, 1 })))
               )
             )

Stops(System.Action)

Defines the configuration of the gradient color stops.

Parameters

configurator - System.Action<DiagramShapeDefaultsFillGradientSettingsStopFactory>

The action that configures the gradient color stops.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Fill(f => f.Gradient(g => g.Stops(s =>
                {
                    s.Add().Offset(0).Color("lightblue").Opacity(0.5);
                    s.Add().Offset(0.5).Color("purple").Opacity(0.8);
                })))
               )
             )

In this article
Not finding the help you need?