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

Kendo UI labels TagHelper ChartAxisDefaultsLabelsSettingsTagHelper class.

Definition

Namespace:Kendo.Mvc.TagHelpers

Assembly:Kendo.Mvc.dll

Syntax:

C#
[HtmlTargetElement("labels", ParentTag = "axis-defaults", TagStructure = TagStructure.NormalOrSelfClosing)]
[RestrictChildren("chart-axis-defaults-labels-margin", new string[] { "chart-axis-defaults-labels-padding", "chart-axis-defaults-labels-rotation" })]
[SuppressTagRendering]
public class ChartAxisDefaultsLabelsSettingsTagHelper : TagHelperChildBase, ITagHelper, ITagHelperComponent, ITemplateComponent

Inheritance: objectTagHelperTagHelperChildBaseChartAxisDefaultsLabelsSettingsTagHelper

Implements: ITagHelperITagHelperComponentITemplateComponent

Inherited Members TagHelperChildBase.Init(TagHelperContext)TagHelperChildBase.AddSelfToContext(TagHelperContext)TagHelperChildBase.CreateHandler(string)TagHelperChildBase.IdPrefixTagHelper.Process(TagHelperContext, TagHelperOutput)TagHelper.Orderobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Example:

csharp
@addTagHelper *, Kendo.Mvc

<kendo-chart name="chart">
    <axis-defaults>
        <labels font="20px 'Courier New'"></labels>
    </axis-defaults>
</kendo-chart>

Constructors

Initializes a new instance of the ChartAxisDefaultsLabelsSettingsTagHelper class.

C#
public ChartAxisDefaultsLabelsSettingsTagHelper()

Properties

The font style of the labels. Accepts a valid CSS color string, for example "20px 'Courier New'".

C#
public string Font { get; set; }

The format used to display the labels. Uses kendo.format. Contains one placeholder ("{0}") which represents the category value.

C#
public string Format { get; set; }

If set to true the chart will mirror the axis labels and ticks. If the labels are normally on the left side of the axis, mirroring the axis will render them to the right.

C#
public bool? Mirror { get; set; }

The rotation angle of the labels. By default the labels are not rotated. Can be set to "auto" if the axis is horizontal in which case the labels will be rotated only if the slot size is not sufficient for the entire labels.

C#
[HtmlAttributeName("rotation")]
public string RotationValue { get; set; }

The number of labels to skip. By default no labels are skipped.

C#
public double? Skip { get; set; }

The label rendering step - render every n-th label. By default every label is rendered.

C#
public double? Step { get; set; }

The template which renders the labels.The fields which can be used in the template are: value - the category value; dataItem - the data item, in case a field has been specified. If the category does not have a corresponding item in the data then an empty object will be passed.; format - the default format of the label or culture - the default culture (if set) on the label.

C#
public string Template { get; set; }

The template which renders the labels.The fields which can be used in the template are: value - the category value; dataItem - the data item, in case a field has been specified. If the category does not have a corresponding item in the data then an empty object will be passed.; format - the default format of the label or culture - the default culture (if set) on the label. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string TemplateHandler { get; set; }

The template which renders the labels.The fields which can be used in the template are: value - the category value; dataItem - the data item, in case a field has been specified. If the category does not have a corresponding item in the data then an empty object will be passed.; format - the default format of the label or culture - the default culture (if set) on the label. This option expects the ID of the script element that contains the template.

C#
public string TemplateId { get; set; }

Configures the templates for the ChartAxisDefaultsLabelsSettings.

C#
[HtmlAttributeNotBound]
public IDictionary<string, string> Templates { get; }

Implements: ITemplateComponent.Templates

The template which renders the labels.The fields which can be used in the template are: value - the category value; dataItem - the data item, in case a field has been specified. If the category does not have a corresponding item in the data then an empty object will be passed.; format - the default format of the label or culture - the default culture (if set) on the label. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent TemplateView { get; set; }

If set to true the chart will display the axis labels. By default the axis labels are visible.

C#
public bool? Visible { get; set; }

A function that can be used to create a custom visual for the labels. The available argument fields are: createVisual - a function that can be used to get the default visual.; culture - the default culture (if set) on the label; dataItem - the data item, in case a field has been specified; format - the default format of the label; options - the label options.; rect - the kendo.geometry.Rect that defines where the visual should be rendered.; sender - the chart instance (may be undefined).; text - the label text. or value - the category value.

C#
public string Visual { get; set; }

Methods

Adds the current TagHelper instance to its parent TagHelper.

C#
protected override void AddSelfToParent(TagHelperContext context)
Parameters:contextTagHelperContext

The TagHelper context.

Overrides: TagHelperChildBase.AddSelfToParent(TagHelperContext)

C#
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Parameters:contextTagHelperContextoutputTagHelperOutputReturns:

Task

Overrides: TagHelperChildBase.ProcessAsync(TagHelperContext, TagHelperOutput)

Serializes the defined settings.

C#
public Dictionary<string, object> Serialize()
Returns:

Dictionary<string, object>

Serializes the defined templates.

C#
public Dictionary<string, object> SerializeTemplates()
Returns:

Dictionary<string, object>