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

SparklineBuilder

Properties

WriteAction - Func

Methods

Data(System.Collections.IEnumerable)

Sets the Sparkline data.

Parameters

data - System.Collections.IEnumerable

The data for the default Sparkline series.

Example


            @(Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .Data(new int[] { 1, 2 })
            );

Data(System.Double)

Sets the Sparkline data.

Parameters

data - System.Double

The data for the default Sparkline series.

Example


             @( Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .Data(new int[] { 1, 2 })
            )

Type(Kendo.Mvc.UI.SparklineType)

Sets the type of the sparkline.

Parameters

type - SparklineType

The Sparkline type.

Example


            @(Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .Type(SparklineType.Area)
            );

CategoryAxis(System.Action)

Configures the category axis

Parameters

configurator - System.Action<ChartCategoryAxisBuilder>

The configurator

Example


             @( Html.Kendo().Sparkline(Model)
                        .Name("Sparkline")
                        .CategoryAxis(axis => axis
                            .Categories(s => s.DateString)
                        )
            )

DataSource(System.Action)

Data Source configuration

Parameters

configurator - System.Action<ReadOnlyAjaxDataSourceBuilder>

Use the configurator to set different data binding options.

Example


             @(Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .DataSource(ds =>
                        {
                            ds.Ajax().Read(r => r.Action("SalesData", "Chart"));
                        })
            )

SeriesDefaults(System.Action)

Defines the options for all chart series of the specified type.

Parameters

configurator - System.Action<ChartSeriesDefaultsSettingsBuilder>

The configurator.

Example


             @( Html.Kendo().Sparkline(Model)
                        .Name("Sparkline")
                        .SeriesDefaults(series => series.Bar().Stack(true))
            )

ValueAxis(System.Action)

Configures the default value axis or adds a new one

Parameters

configurator - System.Action<ChartValueAxisBuilder>

The configurator for the axis

Example


             @( Html.Kendo().Sparkline(Model)
                        .Name("Sparkline")
                        .ValueAxis(a => a.Numeric().Title("content"))
            )

XAxis(System.Action)

Configures the default X axis or adds a new one

Parameters

configurator - System.Action<ChartXAxisBuilder>

The configurator for the axis

Example


             @( Html.Kendo().Sparkline(Model)
                        .Name("Sparkline")
                        .XAxis(a => a.Numeric().Title("content"))
            )

AutoBind(System.Boolean)

If set to false the widget will not bind to the data source during initialization. In this case data binding will occur when the change event of the data source is fired. By default the widget will bind to the data source specified in the configuration.

Parameters

value - System.Boolean

The value for AutoBind

Example


             @( Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .DataSource(ds =>
                        {
                            ds.Ajax().Read(r => r.Action("SalesData", "Sparkline"));
                        })
                        .AutoBind(false)
            )

AxisDefaults(System.Action)

The default options for all chart axes. Accepts the options supported by categoryAxis, valueAxis, xAxis and yAxis.

Parameters

configurator - System.Action<ChartAxisDefaultsSettingsBuilder>

The configurator for the axisdefaults setting.

Example


             @( Html.Kendo().Sparkline(Model)
                        .Name("Sparkline")
                        .AxisDefaults(axisDefaults => axisDefaults.MinorTickSize(5))
            )

ChartArea(System.Action)

The chart area configuration options. Represents the entire visible area of the chart.

Parameters

configurator - System.Action<ChartChartAreaSettingsBuilder>

The configurator for the chartarea setting.

Example


             @( Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .ChartArea(chartArea => chartArea.margin(20))
            )

Legend(System.Action)

The chart legend configuration options.

Parameters

configurator - System.Action<ChartLegendSettingsBuilder>

The configurator for the legend setting.

Example


             @( Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .Legend(l => l.Width(200))
            )

Legend(System.Boolean)

Sets the legend visibility.

Parameters

visible - System.Boolean

A value indicating whether to show the legend.

Example


             @(Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .Legend(false)
            );

Panes(System.Action)

The chart panes configuration.Panes are used to split the chart in two or more parts. The panes are ordered from top to bottom.Each axis can be associated with a pane by setting its pane option to the name of the desired pane. Axis that don't have specified pane are placed in the top (default) pane.Series are moved to the desired pane by associating them with an axis.

Parameters

configurator - System.Action<ChartPaneFactory>

The configurator for the panes setting.

Example


             @( Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .Panes(p => p.Add().Title("content"))
            )

Pdf(System.Action)

Configures the export settings for the saveAsPDF method.

Parameters

configurator - System.Action<ChartPdfSettingsBuilder>

The configurator for the pdf setting.

Example


             @( Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .Pdf(pdf => pdf.KeepPNG(true))
            )

PlotArea(System.Action)

The plot area configuration options. The plot area is the area which displays the series.

Parameters

configurator - System.Action<ChartPlotAreaSettingsBuilder>

The configurator for the plotarea setting.

Example


             @( Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .PlotArea(plotArea => plotArea.margin(20))
            )

Series(System.Action)

The configuration of the chart series.The series type is determined by the value of the type field. If a type value is missing, the type is assumed to be the one specified in seriesDefaults.

Parameters

configurator - System.Action<ChartSeriesFactory>

The configurator for the series setting.

Example


             @( Html.Kendo().Sparkline(Model)
                        .Name("Sparkline")
                        .Series(series =>
                        {
                            series.Bar(s => s.SalesAmount);
                        })
            )

SeriesColors(System.String[])

The default colors for the chart's series. When all colors are used, new colors are pulled from the start again.

Parameters

value - System.String[]

The value for SeriesColors

Example


             @( Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .SeriesColors(new string[] { "#f00", "#0f0", "#00f" })
            )

Theme(System.String)

The chart theme.The supported values are:

Parameters

value - System.String

The value for Theme

Example


             @( Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .Theme("Telerik")
            )

Title(System.Action)

The chart title configuration options or text.

Parameters

configurator - System.Action<ChartTitleSettingsBuilder>

The configurator for the title setting.

Example


             @( Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .Title(t => t.Text("content"))
            )

Title(System.String)

The chart title.

Parameters

title - System.String

The value of the Chart title

Example


             @( Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .Title("value")
            )

Tooltip(System.Action)

The chart series tooltip configuration options.

Parameters

configurator - System.Action<ChartTooltipSettingsBuilder>

The configurator for the tooltip setting.

Example


             @( Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .Tooltip(tooltip =>
                        {
                            tooltip.Visible(true).Format("{0:C}");
                        })
            )

Tooltip(System.Boolean)

Sets the data point tooltip visibility.

Parameters

visible - System.Boolean

A value indicating if the data point tooltip should be displayed. The tooltip is not visible by default.

Example


            @(Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .Tooltip(true)
            );

Transitions(System.Boolean)

If set to true the chart will play animations when displaying the series. By default animations are enabled.

Parameters

value - System.Boolean

The value for Transitions

Example


             @( Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .Transitions(false)
            )

RenderAs(Kendo.Mvc.UI.RenderingMode)

Specifies the preferred widget rendering mode.

Parameters

value - RenderingMode

The value for RenderAs

Example


             @( Html.Kendo().Sparkline()
                        .Name("Sparkline")
                        .RenderAs(RenderingMode.Canvas)
            )

Events(System.Action)

Configures the client-side events.

Parameters

configurator - System.Action<ChartEventBuilder>

The client events action.

Example


            @(Html.Kendo().Sparkline()
                  .Name("Sparkline")
                  .Events(events => events
                      .AxisLabelClick("onAxisLabelClick")
                  )
            )

PointWidth(System.Double)

The width to allocate for each data point.

Parameters

value - System.Double

The value for PointWidth

Events(System.Action)

Configures the client-side events.

Parameters

configurator - System.Action<SparklineEventBuilder>

The client events action.

Example


            @(Html.Kendo().Sparkline()
                  .Name("Sparkline")
                  .Events(events => events
                      .AxisLabelClick("onAxisLabelClick")
                  )
            )

ToComponent()

Returns the internal view component.

Expression(System.String)

Sets the name of the component.

Parameters

modelExpression - System.String

Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)

Sets the name of the component.

Parameters

modelExplorer - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name.

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with

Parameters

deferred - System.Boolean

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

The HTML attributes.

ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Object

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

Render()

Renders the component in place.

ToHtmlString()

WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)

Parameters

writer - System.IO.TextWriter
encoder - System.Text.Encodings.Web.HtmlEncoder

ToClientTemplate()

AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

Parameters

value - System.Boolean
In this article
Not finding the help you need?