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

Defines the fluent interface for configuring ChartAxisCrosshairTooltipBuilder.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class ChartAxisCrosshairTooltipBuilder

Inheritance: objectChartAxisCrosshairTooltipBuilder

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

C#
public ChartAxisCrosshairTooltipBuilder(ChartAxisCrosshairTooltip tooltip)
Parameters:tooltipChartAxisCrosshairTooltip

The chart crosshair tooltip.

Methods

Sets the background color of the tooltip.

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

The value that configures the background color.

Returns:

ChartAxisCrosshairTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Crosshair(crosshair => crosshair
.Visible(true)
.Tooltip(tooltip => tooltip.Background("green").Visible(true))
)
)
)

Configures the border options of the tooltip.

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

The action that configures the border settings.

Returns:

ChartAxisCrosshairTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis =&gt; axis
.Crosshair(crosshair =&gt; crosshair
.Visible(true)
.Tooltip(tooltip =&gt; tooltip.Border(b =&gt; b.Opacity(0.2).Color("black")).Visible(true))
)
)
)

Sets the border of the tooltip.

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

The border width.

colorstring

The border color (CSS syntax).

Returns:

ChartAxisCrosshairTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis =&gt; axis
.Crosshair(crosshair =&gt; crosshair
.Visible(true)
.Tooltip(tooltip =&gt; tooltip.Border(1, "black").Visible(true))
)
)
)

Sets the text color of the tooltip. The option accepts a valid CSS color string, including HEX and RGB.

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

The value that configures the text color.

Returns:

ChartAxisCrosshairTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis =&gt; axis
.Crosshair(crosshair =&gt; crosshair
.Visible(true)
.Tooltip(tooltip =&gt; tooltip.Color("red").Visible(true))
)
)
)

Sets the tooltip font.

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

The value of the tooltip font (CSS syntax).

Returns:

ChartAxisCrosshairTooltipBuilder

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

Sets the format used to display the tooltip. The option uses the kendo.format() method and contains one placeholder ("{0}") which represents the category value.

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

The value that configures the format.

Returns:

ChartAxisCrosshairTooltipBuilder

The format string is ignored if the tooltip uses a template.

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

Sets the tooltip opacity.

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

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

Returns:

ChartAxisCrosshairTooltipBuilder

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

Sets the padding of the crosshair tooltip.

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

The top padding value.

rightint

The right padding value.

bottomint

The bottom padding value.

leftint

The left padding value.

Returns:

ChartAxisCrosshairTooltipBuilder

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

Sets the padding of the crosshair tooltip.

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

The value that configures all paddings.

Returns:

ChartAxisCrosshairTooltipBuilder

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

Defines the CSS position of the crosshair tooltip.

C#
public ChartAxisCrosshairTooltipBuilder Position(string value)
Parameters:valuestring

The value that configures the CSS position.

Returns:

ChartAxisCrosshairTooltipBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis =&gt; axis
.Crosshair(crosshair =&gt; crosshair
.Visible(true)
.Tooltip(tooltip =&gt; tooltip.Position("bottom").Visible(true))
)
)
)

Defines the template that renders the tooltip.

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

The value that configures the template content.

Returns:

ChartAxisCrosshairTooltipBuilder

A client-side template for the tooltip.

  • value - The point value.

The format string is ignored if a template is set.

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis =&gt; axis
.Crosshair(crosshair =&gt; crosshair
.Visible(true)
.Tooltip(tooltip =&gt; tooltip.Template("|&lt;#= value #|&gt;").Visible(true))
)
)
)

Sets the visibility of the crosshair tooltip.

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

The value that toggles the visibility of the tooltip.

Returns:

ChartAxisCrosshairTooltipBuilder

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