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

Defines the fluent interface for configuring the gauge labels.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

TBuilder

Syntax:

C#
public abstract class GaugeLabelsBuilder<TBuilder> where TBuilder : GaugeLabelsBuilder<TBuilder>

Inheritance: objectGaugeLabelsBuilder<TBuilder>

Derived Classes: GaugeLinearScaleLabelsBuilderGaugeRadialScaleLabelsBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the GaugeLabelsBuilder<TBuilder> class.

C#
public GaugeLabelsBuilder(GaugeScaleLabelsBase scaleLabels)
Parameters:scaleLabelsGaugeScaleLabelsBase

The labels configuration.

Methods

Sets the labels background color

C#
public TBuilder Background(string background)
Parameters:backgroundstring

The labels background color.

Returns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.Background("Red")
)
)
)

Configures the label border

C#
public TBuilder Border(Action<ChartBorderBuilder> configurator)
Parameters:configuratorAction<ChartBorderBuilder>

The border configuration action

Returns:

TBuilder

Sets the labels border

C#
public TBuilder Border(int width, string color, ChartDashType dashType)
Parameters:widthint

The labels border width.

colorstring

The labels border color (CSS syntax).

dashTypeChartDashType

The labels border dash type.

Returns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.Border(1, "Red", ChartDashType.Dot)
)
)
)

Sets the labels text color

C#
public TBuilder Color(string color)
Parameters:colorstring

The labels text color.

Returns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.Color("Red")
)
)
)

Sets the labels font

C#
public TBuilder Font(string font)
Parameters:fontstring

The labels font (CSS format).

Returns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.Font("14px Arial,Helvetica,sans-serif")
)
)
)

Sets the labels format.

C#
public TBuilder Format(string format)
Parameters:formatstring

The labels format.

Returns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.Format("{0:C}")
)
)
)

Sets the labels margin

C#
public TBuilder Margin(int top, int right, int bottom, int left)
Parameters:topint

The labels top margin.

rightint

The labels right margin.

bottomint

The labels bottom margin.

leftint

The labels left margin.

Returns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.Margin(0, 5, 5, 0)
)
)
)els

Sets the labels margin

C#
public TBuilder Margin(int margin)
Parameters:marginint

The labels margin.

Returns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.Margin(20)
)
)
)

Sets the labels opacity.

C#
public TBuilder Opacity(double opacity)
Parameters:opacitydouble

The series opacity in the range from 0 (transparent) to 1 (opaque). The default value is 1.

Returns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.Opacity(0.5)
)
)
)

Sets the labels padding

C#
public TBuilder Padding(int top, int right, int bottom, int left)
Parameters:topint

The labels top padding.

rightint

The labels right padding.

bottomint

The labels bottom padding.

leftint

The labels left padding.

Returns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.Padding(0, 5, 5, 0)
)
)
)

Sets the labels padding

C#
public TBuilder Padding(int padding)
Parameters:paddingint

The labels padding.

Returns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.Padding(20)
)
)
)

Sets the labels template.

C#
public TBuilder Template(string template)
Parameters:templatestring

The labels template.

Returns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.Template("#= value #")
)
)
)

Sets the labels template.

C#
public TBuilder Template(TemplateBuilder<dynamic> template)
Parameters:templateTemplateBuilder<dynamic>

The labels template.

Returns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.Template(Html.Kendo().Template()
.AddHtml("{data.value}%")
)
)
)
)

Sets the labels template.

C#
public TBuilder TemplateHandler(string handler)
Parameters:handlerstring

The labels template.

Returns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.TemplateHandler("labelsHandler")
)
)
)

Sets the labels template.

C#
public TBuilder TemplateView(HtmlString templateView)
Parameters:templateViewHtmlStringReturns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.TemplateView(Html.Partial("myPartial"))
)
)
)

Sets the labels visibility

C#
public TBuilder Visible(bool visible)
Parameters:visiblebool

The labels visibility.

Returns:

TBuilder

Example:
C#
@( Html.Kendo().LinearGauge()
.Name("linearGauge")
.Scale(scale =&gt; scale
.Labels(labels =&gt; labels
.Visible(false)
)
)
)