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

Defines the fluent interface for configuring the chart data points tooltip.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class ChartTooltipBuilder

Inheritance: objectChartTooltipBuilder

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 ChartTooltipBuilder class.

C#
public ChartTooltipBuilder(ChartTooltip chartTooltip)
Parameters:chartTooltipChartTooltip

The data point tooltip configuration.

Methods

Specifies if the tooltip will be hidden when the mouse leaves the target element. If set to false, a Close button will be shown within tooltip.

C#
public ChartTooltipBuilder AutoHide(bool value)
Parameters:valuebool

The value for AutoHide

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip => tooltip
.Visible(true)
.AutoHide(false)
)
)

Sets the tooltip background color

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

The tooltip background color. The default is determined from the series color.

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip => tooltip
.Background("Red")
.Visible(true)
)
)

Configures the tooltip border

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

The border configuration action

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Border(border =&gt; border.Width(1).Color("red"))
.Visible(true)
)
)

Sets the tooltip border

C#
public ChartTooltipBuilder Border(int width, string color)
Parameters:widthint

The tooltip border width.

colorstring

The tooltip border color (CSS syntax).

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Border(1, "Red")
.Visible(true)
)
)

Sets the tooltip text color

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

The tooltip text color. The default is the same as the series labels color.

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Color("Red")
.Visible(true)
)
)

Sets the tooltip font

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

The tooltip font (CSS format).

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Font("14px Arial,Helvetica,sans-serif")
.Visible(true)
)
)

Sets the tooltip format

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

The tooltip format.

Returns:

ChartTooltipBuilder

The format string is ignored if a template is set.

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Format("{0:C}")
.Visible(true)
)
)

Sets the tooltip opacity.

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

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

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Opacity(0.5)
.Visible(true)
)
)

Sets the tooltip padding

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

The tooltip top padding.

rightint

The tooltip right padding.

bottomint

The tooltip bottom padding.

leftint

The tooltip left padding.

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Padding(0, 5, 5, 0)
.Visible(true)
)
)

Sets the tooltip padding

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

The tooltip padding.

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Padding(20)
.Visible(true)
)
)

Sets the tooltip shared

C#
public ChartTooltipBuilder Shared(bool shared)
Parameters:sharedbool

The tooltip shared.

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Visible(true)
.Shared(true)
)
)

Sets the tooltip shared template

C#
public ChartTooltipBuilder SharedTemplate(string sharedTemplate)
Parameters:sharedTemplatestring

The tooltip shared template.

Returns:

ChartTooltipBuilder

A client-side shared template for the tooltip.

  • points - the category points
  • category - the category name
Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Template("#= category #")
.Visible(true)
)
)

Sets the tooltip template

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

The tooltip template.

Returns:

ChartTooltipBuilder

A client-side template for the tooltip.

  • value - the point value
  • category - the category name
  • series - the data series configuration object
  • dataItem - the original data item (client-side binding only)

The format string is ignored if a template is set.

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Template("#= category # -#= value #")
.Visible(true)
)
)

The template which renders the ARIA label for the series labels.The fields which can be used in the template are: category - the category name. Available for area, bar, column, bubble, donut, line and pie series.; dataItem - the original data item used to construct the point. Will be null if binding to array.; percentage - the point value represented as a percentage value. Available only for 100% stacked charts.; series - the data series or value - the point value. Can be a number or object containing each bound field..

C#
public ChartTooltipBuilder Template<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the ariatemplate.

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Visible(true)
.Template(Html.Kendo().Template().AddHtml("&lt;b&gt;Content&lt;/b&gt;"))
)
)

The function that returns the content for the tooltip

C#
public ChartTooltipBuilder TemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Visible(true)
.TemplateId("handler")
)
)

The Id of the Kendo template that sets the tooltip template

C#
public ChartTooltipBuilder TemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for the template

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Visible(true)
.TemplateId("template-id")
)
)

Sets the tooltip template

C#
public ChartTooltipBuilder TemplateView(MvcHtmlString templateView)
Parameters:templateViewMvcHtmlString

The view that contains the template

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Visible(true)
.TemplateView(Html.Partial("ChartTemplateView"))
)
)

Sets the tooltip visibility

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

The tooltip visibility. The tooltip is not visible by default.

Returns:

ChartTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Tooltip(tooltip =&gt; tooltip
.Visible(true)
)
)