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

Defines the fluent API for configuring the Kendo UI StockChart

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

T

Syntax:

C#
public class StockChartBuilder<T> : WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>, IHtmlContent where T : class

Inheritance: objectHelperResultWidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>StockChartBuilder<T>

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.ToComponent()WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.Expression(string)WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.Explorer(ModelExplorer)WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.Name(string)WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.Deferred(bool)WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.HtmlAttributes(object)WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.ScriptAttributes(object, bool)WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.Render()WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.ToHtmlString()WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.ToClientTemplate()WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.AsModule(bool)WidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.ComponentWidgetBuilderBase<StockChart<T>, StockChartBuilder<T>>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.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 StockChartBuilder<T> class.

C#
public StockChartBuilder(StockChart<T> component)
Parameters:componentStockChart<T>

Methods

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.

C#
public StockChartBuilder<T> AutoBind(bool value)
Parameters:valuebool

The value for AutoBind

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.AutoBind(false)
.DataSource(ds =&gt;
{
ds.Ajax().Read(r =&gt; r.Action("SalesData", "Chart"));
})
)

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

C#
public StockChartBuilder<T> AxisDefaults(Action<ChartAxisDefaultsSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartAxisDefaultsSettingsBuilder<T>>

The configurator for the axisdefaults setting.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.AxisDefaults(axisDefaults =&gt; axisDefaults.MinorTickSize(5))
)

Configures the category axis

C#
public StockChartBuilder<T> CategoryAxis(Action<ChartCategoryAxisBuilder<T>> configurator)
Parameters:configuratorAction<ChartCategoryAxisBuilder<T>>

The configurator

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Categories(s =&gt; s.DateString)
)
)

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

C#
public StockChartBuilder<T> ChartArea(Action<ChartChartAreaSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartChartAreaSettingsBuilder<T>>

The configurator for the chartarea setting.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.ChartArea(chartArea =&gt; chartArea.Margin(20))
)

Data Source configuration

C#
public StockChartBuilder<T> DataSource(Action<ReadOnlyAjaxDataSourceBuilder<T>> configurator)
Parameters:configuratorAction<ReadOnlyAjaxDataSourceBuilder<T>>

Use the configurator to set different data binding options.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@(Html.Kendo().StockChart()
.Name("Chart")
.DataSource(ds =&gt;
{
ds.Ajax().Read(r =&gt; r.Action("SalesData", "Chart"));
})
)

The field containing the point date. It is used as a default categoryField for all series.The data item field value must be either: Date instance. String parsable by new Date([field value]). String in ASP.NET JSON format, i.e. "/Date(1320825600000-0800)/".

C#
public StockChartBuilder<T> DateField(string value)
Parameters:valuestring

The value for DateField

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Configures the client-side events.

C#
public StockChartBuilder<T> Events(Action<ChartEventBuilder> configurator)
Parameters:configuratorAction<ChartEventBuilder>

The client events action.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@(Html.Kendo().StockChart()
.Name("Chart")
.Events(events =&gt; events
.AxisLabelClick("onAxisLabelClick")
)
)

Configures the client-side events.

C#
public StockChartBuilder<T> Events(Action<StockChartEventBuilder> configurator)
Parameters:configuratorAction<StockChartEventBuilder>

The client events action.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@(Html.Kendo().StockChart()
.Name("StockChart")
.Events(events =&gt; events
.AxisLabelClick("onAxisLabelClick")
)
)

The chart legend configuration options.

C#
public StockChartBuilder<T> Legend(Action<ChartLegendSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartLegendSettingsBuilder<T>>

The configurator for the legend setting.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.Legend(legend =&gt; legend.Visible(true).Position(ChartLegendPosition.Bottom))
)

Sets the legend visibility.

C#
public StockChartBuilder<T> Legend(bool visible)
Parameters:visiblebool

A value indicating whether to show the legend.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.Legend(false)
)

Allows localization of the strings that are used in the widget.

C#
public StockChartBuilder<T> Messages(Action<ChartMessagesSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartMessagesSettingsBuilder<T>>

The configurator for the messages setting.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.Messages(messages =&gt; messages.NoData("No data available."))
)

The data navigator configuration options.

C#
public StockChartBuilder<T> Navigator(Action<StockChartNavigatorSettingsBuilder<T>> configurator)
Parameters:configuratorAction<StockChartNavigatorSettingsBuilder<T>>

The StockChartNavigatorSettingsBuilder<T> for the navigator setting.

Returns:

StockChartBuilder<T>

Returns the current instance of StockChartBuilder<T> .

When no series data is available, the StockChart will display an overlay element that contains a message with the text "No data available". The overlay will be automatically cleared if the series receive data.

C#
public StockChartBuilder<T> NoData(Action<ChartNoDataSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartNoDataSettingsBuilder<T>>

The configurator for the nodata setting.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.NoData(noData =&gt; noData.Template("#= 'No data' #"))
)

When no series data is available, the StockChart will display an overlay element that contains a message with the text "No data available". To disable the "No Data" overlay, set this option to false.

C#
public StockChartBuilder<T> NoData(bool enabled)
Parameters:enabledbool

Enables or disables the nodata option.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.NoData(false)
)

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.

C#
public StockChartBuilder<T> Panes(Action<ChartPaneFactory<T>> configurator)
Parameters:configuratorAction<ChartPaneFactory<T>>

The configurator for the panes setting.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.Panes(panes =&gt;
{
panes.Add("volume");
})
)

Specifies if the chart can be panned.

C#
public StockChartBuilder<T> Pannable()
Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.Pannable()
)

Specifies if the chart can be panned.

C#
public StockChartBuilder<T> Pannable(Action<ChartPannableSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartPannableSettingsBuilder<T>>

The configurator for the pannable setting.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.Pannable(pan =&gt; pan.Lock(ChartAxisLock.X))
)

Specifies if the chart can be panned.

C#
public StockChartBuilder<T> Pannable(bool enabled)
Parameters:enabledbool

Enables or disables the pannable option.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.Pannable(false)
)

Configures the export settings for the saveAsPDF method.

C#
public StockChartBuilder<T> Pdf(Action<ChartPdfSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartPdfSettingsBuilder<T>>

The configurator for the pdf setting.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.Pdf(pdf =&gt; pdf.FileName("MyChart.pdf"))
)

Specifies if the series visible option should be persisted when changing the dataSource data.

C#
public StockChartBuilder<T> PersistSeriesVisibility(bool value)
Parameters:valuebool

The value for PersistSeriesVisibility

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

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

C#
public StockChartBuilder<T> PlotArea(Action<ChartPlotAreaSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartPlotAreaSettingsBuilder<T>>

The configurator for the plotarea setting.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.PlotArea(plotArea =&gt; plotArea.Margin(20))
)

Specifies the preferred widget rendering mode.

C#
public StockChartBuilder<T> RenderAs(RenderingMode value)
Parameters:valueRenderingMode

The value for RenderAs

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.RenderAs(RenderingMode.SVG)
)

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.

C#
public StockChartBuilder<T> Series(Action<ChartSeriesFactory<T>> configurator)
Parameters:configuratorAction<ChartSeriesFactory<T>>

The configurator for the series setting.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.Series(series =&gt;
{
series.Bar(s =&gt; s.SalesAmount);
})
)

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

C#
public StockChartBuilder<T> SeriesColors(params string[] value)
Parameters:valuestring[]

The value for SeriesColors

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.SeriesColors(new string[] { "#f00", "#0f0", "#00f" })
)

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

C#
public StockChartBuilder<T> SeriesDefaults(Action<ChartSeriesDefaultsSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartSeriesDefaultsSettingsBuilder<T>>

The configurator.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.SeriesDefaults(series =&gt; series.Bar().Stack(true))
)

The chart theme.The supported values are:

C#
public StockChartBuilder<T> Theme(string value)
Parameters:valuestring

The value for Theme

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.Theme("sass")
)

The chart title configuration options or text.

C#
public StockChartBuilder<T> Title(Action<ChartTitleSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartTitleSettingsBuilder<T>>

The configurator for the title setting.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.Title("Yearly sales")
)

The chart title.

C#
public StockChartBuilder<T> Title(string title)
Parameters:titlestring

The value of the Chart title

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.Title("Yearly sales")
)

The chart series tooltip configuration options.

C#
public StockChartBuilder<T> Tooltip(Action<ChartTooltipSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartTooltipSettingsBuilder<T>>

The configurator for the tooltip setting.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

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

Sets the data point tooltip visibility.

C#
public StockChartBuilder<T> Tooltip(bool visible)
Parameters:visiblebool

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

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@(Html.Kendo().StockChart()
.Name("Chart")
.Tooltip(true)
);

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

C#
public StockChartBuilder<T> Transitions(bool value)
Parameters:valuebool

The value for Transitions

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.Transitions(false)
)

Configures the default value axis or adds a new one

C#
public StockChartBuilder<T> ValueAxis(Action<ChartValueAxisBuilder<T>> configurator)
Parameters:configuratorAction<ChartValueAxisBuilder<T>>

The configurator for the axis

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.ValueAxis(a =&gt; a.Numeric().TickSize(4))
)

Configures the default X axis or adds a new one

C#
public StockChartBuilder<T> XAxis(Action<ChartXAxisBuilder<T>> configurator)
Parameters:configuratorAction<ChartXAxisBuilder<T>>

The configurator for the axis

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.XAxis(a =&gt; a.Numeric().Max(4))
)

Specifies if the chart can be zoomed.

C#
public StockChartBuilder<T> Zoomable()
Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.Zoomable()
)

Specifies if the chart can be zoomed.

C#
public StockChartBuilder<T> Zoomable(Action<ChartZoomableSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartZoomableSettingsBuilder<T>>

The configurator for the zoomable setting.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.Zoomable(zoom =&gt; zoom.Mousewheel(mw =&gt; mw.Lock(ChartAxisLock.X)))
)

Specifies if the chart can be zoomed.

C#
public StockChartBuilder<T> Zoomable(bool enabled)
Parameters:enabledbool

Enables or disables the zoomable option.

Returns:

StockChartBuilder<T>

Returns the current StockChartBuilder<T> instance.

Example:
C#
@( Html.Kendo().StockChart()
.Name("Chart")
.Zoomable(false)
)