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

ChartAxisCrosshairTooltipBuilder

Methods

Font(System.String)

Sets the tooltip font.

Parameters

font - System.String

The value of the tooltip font (CSS syntax).

Example


            @(Html.Kendo().Chart()
                      .Name("chart")
                      .CategoryAxis(axis => axis
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip
                                     .Font("14px Arial,Helvetica,sans-serif")
                                     .Visible(true)
                                )
                           )
                      )
            )

Visible(System.Boolean)

Sets the visibility of the crosshair tooltip.

Parameters

visible - System.Boolean

The value that toggles the visibility of the tooltip.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .CategoryAxis(axis => axis
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip.Visible(true))
                           )
                      )
            )

Background(System.String)

Sets the background color of the tooltip.

Parameters

background - System.String

The value that configures the background color.

Example


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

Color(System.String)

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

Parameters

color - System.String

The value that configures the text color.

Example


            @(Html.Kendo().Chart()
                      .Name("chart")
                      .CategoryAxis(axis => axis
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip.Color("red").Visible(true))
                          )
                      )
            )

Padding(System.Int32,System.Int32,System.Int32,System.Int32)

Sets the padding of the crosshair tooltip.

Parameters

top - System.Int32

The top padding value.

right - System.Int32

The right padding value.

bottom - System.Int32

The bottom padding value.

left - System.Int32

The left padding value.

Example


            @(Html.Kendo().Chart()
                      .Name("chart")
                      .CategoryAxis(axis => axis
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip.Padding(0, 5, 5, 0).Visible(true))
                           )
                      )
            )

Padding(System.Int32)

Sets the padding of the crosshair tooltip.

Parameters

padding - System.Int32

The value that configures all paddings.

Example


            @(Html.Kendo().Chart()
                      .Name("chart")
                      .CategoryAxis(axis => axis
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip.Padding(20).Visible(true))
                           )
                      )
            )

Border(System.Int32,System.String)

Sets the border of the tooltip.

Parameters

width - System.Int32

The border width.

color - System.String

The border color (CSS syntax).

Example


            @(Html.Kendo().Chart()
                      .Name("chart")
                      .CategoryAxis(axis => axis
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip.Border(1, "black").Visible(true))
                           )
                      )
            )

Border(System.Action)

Configures the border options of the tooltip.

Parameters

configurator - System.Action<ChartBorderBuilder>

The action that configures the border settings.

Example


            @(Html.Kendo().Chart()
                      .Name("chart")
                      .CategoryAxis(axis => axis
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip.Border(b => b.Opacity(0.2).Color("black")).Visible(true))
                           )
                      )
            )

Format(System.String)

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.

Parameters

format - System.String

The value that configures the format.

Example


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

Template(System.String)

Defines the template that renders the tooltip.

Parameters

template - System.String

The value that configures the template content.

Example


            @(Html.Kendo().Chart()
                      .Name("chart")
                      .CategoryAxis(axis => axis
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip.Template("|<#= value #|>").Visible(true))
                           )
                      )
            )

Opacity(System.Double)

Sets the tooltip opacity.

Parameters

opacity - System.Double

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

Example


            @(Html.Kendo().Chart()
                      .Name("chart")
                      .CategoryAxis(axis => axis
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip.Opacity(0.5).Visible(true))
                           )
                      )
            )

Position(System.String)

Defines the CSS position of the crosshair tooltip.

Parameters

value - System.String

The value that configures the CSS position.

Example


            @(Html.Kendo().Chart()
                      .Name("chart")
                      .CategoryAxis(axis => axis
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip.Position("bottom").Visible(true))
                           )
                      )
            )

In this article
Not finding the help you need?