New to Telerik UI for ASP.NET MVC? Start a free 30-day trial
Crosshairs
Crosshairs are lines, which are perpendicular to the axes of the Chart and enable the user to see the exact value at the current cursor position.
Getting Started
By default, the crosshairs of the Telerik UI for ASP.NET MVC Chart are not visible. To enables them, set the visible
property to true
.
Razor
@(Html.Kendo().Chart()
.Name("chart")
.AxisDefaults(defaults => {
defaults.Crosshair(c => c.Visible(true).Tooltip(t => t.Visible(true)));
})
.ChartArea(chartArea => chartArea
.Background("transparent")
)
.Series(series =>
{
series.Column(new double[] { 1, 2, 3 });
})
.CategoryAxis(axis => axis
.Name("label-axis")
.Categories("A", "B", "C")
)
.ValueAxis(axis => axis
.Numeric()
.AxisCrossingValue(0, int.MinValue)
)
)
Customizing the Appearance
The Telerik UI for ASP.NET MVC Chart supports the following properties which enable you to customize the appearance of its crosshairs:
-
Color()
—Sets the color of the crosshair. -
DashType()
—Sets the dash type of the crosshair.The available dash-type options are:
Dash
—A line consisting of dashes.DashDot
—A line consisting of a repeated dash-dot pattern.Dot
—A line consisting of dots.LongDash