StockChartBuilder
Methods
DateField(System.String)
Sets the field used by all date axes (including the navigator).
Parameters
dateField - System.String
The date field.
Example
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.DateField("Date")
)
AutoBind(System.Boolean)
Enables or disables automatic binding.
Parameters
autoBind - System.Boolean
Gets or sets a value indicating if the chart should be data bound during initialization. The default value is true.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.DataSource(ds =>
{
ds.Ajax().Read(r => r.Action("SalesData", "Chart"));
})
.AutoBind(false)
)
Navigator(System.Action)
Configures the stock chart navigator.
Parameters
configurator - System.Action<ChartNavigatorBuilder>
The navigator configuration action.
Example
@( Html.Kendo().StockChart(Model)
.Name("StockChart")
.Navigator(nav => nav
.Series(series =>
{
series.Line(s => s.Volume);
})
)
)
Events(System.Action)
Configures the client-side events.
Parameters
configurator - System.Action<ChartEventBuilder>
The client events configuration action.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.Events(events => events
.OnLoad("onLoad")
)
)
Theme(System.String)
Sets the theme of the chart.
Parameters
theme - System.String
The Chart theme.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.Theme("sass")
)
RenderAs(Kendo.Mvc.UI.RenderingMode)
Sets the preferred rendering engine. If it is not supported by the browser, the Chart will switch to the first available mode.
Parameters
renderAs - RenderingMode
The preferred rendering engine.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.RenderAs(RenderingMode.SVG)
)
ChartArea(System.Action)
Sets the Chart area.
Parameters
configurator - System.Action<ChartAreaBuilder>
The Chart area.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.ChartArea(chartArea => chartArea.Margin(20))
)
PlotArea(System.Action)
Sets the Plot area.
Parameters
configurator - System.Action<PlotAreaBuilder>
The Plot area.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.PlotArea(plotArea => plotArea.Margin(20))
)
Title(System.String)
Sets the title of the chart.
Parameters
title - System.String
The Chart title.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.Title("Yearly sales")
)
Title(System.Action)
Defines the title of the chart.
Parameters
configurator - System.Action<ChartTitleBuilder>
The configuration action.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.Title(title => title.Text("Yearly sales"))
)
Legend(System.Boolean)
Sets the legend visibility.
Parameters
visible - System.Boolean
A value indicating whether to show the legend.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.Legend(false)
)
Legend(System.Action)
Configures the legend.
Parameters
configurator - System.Action<ChartLegendBuilder>
The configuration action.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.Legend(legend => legend.Visible(true).Position(ChartLegendPosition.Bottom))
)
Series(System.Action)
Defines the chart series.
Parameters
configurator - System.Action<ChartSeriesFactory>
The add action.
Example
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.Series(series =>
{
series.Bar(s => s.SalesAmount);
})
)
SeriesDefaults(System.Action)
Defines the options for all chart series of the specified type.
Parameters
configurator - System.Action<ChartSeriesDefaultsBuilder>
The configurator.
Example
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.SeriesDefaults(series => series.Bar().Stack(true))
)
Panes(System.Action)
Defines the chart panes.
Parameters
configurator - System.Action<ChartPanesFactory>
The add action.
Example
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.Panes(panes =>
{
panes.Add("volume");
})
)
AxisDefaults(System.Action)
Defines the options for all chart axes of the specified type.
Parameters
configurator - System.Action<ChartAxisDefaultsBuilder>
The configurator.
Example
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.AxisDefaults(axisDefaults => axisDefaults.MinorTickSize(5))
)
CategoryAxis(System.Action)
Configures the category axis
Parameters
configurator - System.Action<ChartCategoryAxisBuilder>
The configurator
Example
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.CategoryAxis(axis => axis
.Categories(s => s.DateString)
)
)
ValueAxis(System.Action)
Defines value axis options
Parameters
configurator - System.Action<ChartValueAxisFactory>
The configurator
Example
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.ValueAxis(a => a.Numeric().TickSize(4))
)
XAxis(System.Action)
Defines X-axis options for scatter charts
Parameters
configurator - System.Action<ChartValueAxisFactory>
The configurator
Example
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.XAxis(a => a.Numeric().Max(4))
)
YAxis(System.Action)
Configures Y-axis options for scatter charts.
Parameters
configurator - System.Action<ChartValueAxisFactory>
The configurator
Example
@( Html.Kendo().StockChart(Model)
.Name("Chart")
.YAxis(a => a.Numeric().Max(4))
)
DataSource(System.Action)
Data Source configuration
Parameters
configurator - System.Action<ReadOnlyAjaxDataSourceBuilder>
Use the configurator to set different data binding options.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.DataSource(ds =>
{
ds.Ajax().Read(r => r.Action("SalesData", "Chart"));
})
)
SeriesColors(System.Collections.Generic.IEnumerable)
Sets the series colors.
Parameters
colors - System.Collections.Generic.IEnumerable<String>
A list of the series colors.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.SeriesColors(new string[] { "#f00", "#0f0", "#00f" })
)
SeriesColors(System.String[])
Sets the series colors.
Parameters
colors - System.String[]
The series colors.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.SeriesColors("#f00", "#0f0", "#00f")
)
Tooltip(System.Action)
Use it to configure the data point tooltip.
Parameters
configurator - System.Action<ChartTooltipBuilder>
Use the configurator to set data tooltip options.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.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().StockChart()
.Name("Chart")
.Tooltip(true)
)
Transitions(System.Boolean)
Enables or disabled animated transitions on initial load and refresh.
Parameters
transitions - System.Boolean
A value indicating if transition animations should be played.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.Transitions(false)
)
Pdf(System.Action)
Configures the PDF export settings.
Parameters
configurator - System.Action<PDFSettingsBuilder>
Use the configurator to set the pdf export options.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.Pdf(pdf => pdf.FileName("MyChart.pdf"))
)
PersistSeriesVisibility(System.Boolean)
Specifies if the series visible option should be persisted when changing the dataSource data.
Parameters
value - System.Boolean
A value indicating if the visible option should be persisted.
Example
@( Html.Kendo().StockChart()
.Name("Chart")
.PersistSeriesVisibility(false)
)
ToComponent()
Returns the internal view component.
Name(System.String)
Sets the name of the component.
Parameters
componentName - System.String
The name of the component.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
Deferred(System.Boolean)
Suppress initialization script rendering. Note that this options should be used in conjunction with
Parameters
deferred - System.Boolean
ModelMetadata(System.Web.Mvc.ModelMetadata)
Uses the Metadata of the Model.
Parameters
modelMetadata - System.Web.Mvc.ModelMetadata
The metadata set for the Model
HtmlAttributes(System.Object)
Sets the HTML attributes.
Parameters
attributes - System.Object
The HTML attributes.
HtmlAttributes(System.Collections.Generic.IDictionary)
Parameters
attributes - System.Collections.Generic.IDictionary<String,Object>
AsModule(System.Boolean)
Specifies whether the initialization script of the component will be rendered as a JavaScript module.
Parameters
value - System.Boolean
Render()
Renders the component.
Example
@(@Page Inherits="System.Web.Mvc.ViewPage<IEnumerable<Product>>" )
@( Html.Kendo().Grid(Model)
.Name("grid")
.DetailTemplate(product => {
)
Product Details:
<div>Product Name: @( product.ProductName )</div>
<div>Units In Stock: @( product.UnitsInStock )</div>
@(
})
.Render();
)
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.