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

ChartAxisCrosshairTooltipBuilder

Methods

Font(System.String)

Sets the tooltip font

Parameters

font - System.String

The tooltip font (CSS format).

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => {
                           .series.Bar(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World");
                           .series.Bar(new double[] { 67.96, 68.93, 75, 74, 78 }).Name("United States");
                      })
                      .CategoryAxis(axis => axis
                           .Categories("2005", "2006", "2007", "2008", "2009")
                           .Crosshair(crosshair => crosshair
                           .Visible(true)
                                .Tooltip(tooltip => tooltip
                                     .Font("14px Arial,Helvetica,sans-serif")
                                     .Visible(true)
                                )
                           )
                      )
            )

Visible(System.Boolean)

Sets the tooltip visible

Parameters

visible - System.Boolean

The tooltip visible.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => {
                           .series.Bar(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World");
                           .series.Bar(new double[] { 67.96, 68.93, 75, 74, 78 }).Name("United States");
                      })
                      .CategoryAxis(axis => axis
                           .Categories("2005", "2006", "2007", "2008", "2009")
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip
                                     .Visible(true)
                                )
                           )
                      )
            )

Background(System.String)

Sets the tooltip background

Parameters

background - System.String

The tooltip background.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => {
                           .series.Bar(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World");
                           .series.Bar(new double[] { 67.96, 68.93, 75, 74, 78 }).Name("United States");
                      })
                      .CategoryAxis(axis => axis
                           .Categories("2005", "2006", "2007", "2008", "2009")
                           .Crosshair(crosshair => crosshair
                                 .Visible(true)
                                 .Tooltip(tooltip => tooltip
                                      .Background("red")
                                      .Visible(true)
                                 )
                           )
                      )
            )

Color(System.String)

Sets the tooltip text color

Parameters

color - System.String

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

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => {
                           .series.Bar(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World");
                           .series.Bar(new double[] { 67.96, 68.93, 75, 74, 78 }).Name("United States");
                      })
                      .CategoryAxis(axis => axis
                           .Categories("2005", "2006", "2007", "2008", "2009")
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip
                                     .color("red")
                                     .Visible(true)
                                )
                          )
                      )
            )

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

Sets the tooltip padding

Parameters

top - System.Int32

The tooltip top padding.

right - System.Int32

The tooltip right padding.

bottom - System.Int32

The tooltip bottom padding.

left - System.Int32

The tooltip left padding.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => {
                           .series.Bar(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World");
                           .series.Bar(new double[] { 67.96, 68.93, 75, 74, 78 }).Name("United States");
                      })
                      .CategoryAxis(axis => axis
                           .Categories("2005", "2006", "2007", "2008", "2009")
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip
                                     .Padding(0, 5, 5, 0)
                                     .Visible(true)
                                )
                           )
                      )
            )

Padding(System.Int32)

Sets the tooltip padding

Parameters

padding - System.Int32

The tooltip padding.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => {
                           .series.Bar(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World");
                           .series.Bar(new double[] { 67.96, 68.93, 75, 74, 78 }).Name("United States");
                      })
                      .CategoryAxis(axis => axis
                           .Categories("2005", "2006", "2007", "2008", "2009")
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip
                                     .Padding(20)
                                     .Visible(true)
                                )
                           )
                      )
            )

Border(System.Int32,System.String)

Sets the tooltip border

Parameters

width - System.Int32

The tooltip border width.

color - System.String

The tooltip border color (CSS syntax).

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => {
                           .series.Bar(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World");
                           .series.Bar(new double[] { 67.96, 68.93, 75, 74, 78 }).Name("United States");
                      })
                      .CategoryAxis(axis => axis
                           .Categories("2005", "2006", "2007", "2008", "2009")
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip
                                     .Border(1, "Red")
                                     .Visible(true)
                                )
                           )
                      )
            )

Border(System.Action)

Configures the tooltip border

Parameters

configurator - System.Action<ChartBorderBuilder>

The border configuration action

Format(System.String)

Sets the tooltip format

Parameters

format - System.String

The tooltip format.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => {
                           .series.Bar(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World");
                           .series.Bar(new double[] { 67.96, 68.93, 75, 74, 78 }).Name("United States");
                      })
                      .CategoryAxis(axis => axis
                           .Categories("2005", "2006", "2007", "2008", "2009")
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip
                                     .Format("{0:C}")
                                     .Visible(true)
                                )
                           )
                      )
            )

Template(System.String)

Sets the tooltip template

Parameters

template - System.String

The tooltip template.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => {
                           .series.Bar(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World");
                           .series.Bar(new double[] { 67.96, 68.93, 75, 74, 78 }).Name("United States");
                      })
                      .CategoryAxis(axis => axis
                           .Categories("2005", "2006", "2007", "2008", "2009")
                           .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")
                      .Series(series => {
                           .series.Bar(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World");
                           .series.Bar(new double[] { 67.96, 68.93, 75, 74, 78 }).Name("United States");
                      })
                      .CategoryAxis(axis => axis
                           .Categories("2005", "2006", "2007", "2008", "2009")
                           .Crosshair(crosshair => crosshair
                                .Visible(true)
                                .Tooltip(tooltip => tooltip
                                     .Opacity(0.5)
                                     .Visible(true)
                                )
                           )
                      )
            )

Position(System.String)

The position of the crosshair tooltip.

Parameters

value - System.String

The value for Position

In this article
Not finding the help you need?