Kendo.Mvc.UI.Fluent.ChartBuilder
Defines the fluent API for configuring the Kendo UI Chart
Methods
Title(System.String)
The chart title.
Parameters
title System.String
The value of the Chart title
SeriesDefaults(System.Action<Kendo.Mvc.UI.Fluent.ChartSeriesDefaultsSettingsBuilder<T>>)
Configures the common series settings
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartSeriesDefaultsSettingsBuilder>
The configurator
Example (ASPX)
@(Html.Kendo().Chart()
.Name("chart")
.SeriesDefaults(seriesDefaults =>
seriesDefaults.Area().Line(line => line.Style(ChartSeriesLineStyle.Smooth))
)
.Series(series =>
{
series.Area(new double[] { 3.907, 7.943, 5.848 }).Name("Result 1");
series.Area(new double[] { 4.223, 6.743, 8.922 }).Name("Result 2");
})
.CategoryAxis(axis => axis
.Categories("2002", "2003", "2004")
)
)
CategoryAxis(System.Action<Kendo.Mvc.UI.Fluent.ChartCategoryAxisBuilder<T>>)
Configures the category axis
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartCategoryAxisBuilder>
The configurator
Example (ASPX)
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =>
{
series.Area(new double[] { 3.907, 7.943, 5.848 }).Name("Result");
})
.CategoryAxis(axis => axis
.Categories("2002", "2003", "2004")
)
)
DataSource(System.Action<Kendo.Mvc.UI.Fluent.ReadOnlyAjaxDataSourceBuilder<T>>)
DataSource configuration
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ReadOnlyAjaxDataSourceBuilder>
Use the configurator to set different data binding options.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.DataSource(ds =>
{
ds.Ajax().Read(r => r.Action("SalesData", "Chart"));
})
)
DataSource(System.String)
Assigns an external DataSource to the Chart
Parameters
dataSourceId System.String
The name of the external DataSource
Example (ASPX)
@(Html.Kendo().DataSource<ProductViewModel>()
.Name("dataSource1")
.Ajax(dataSource => dataSource
.Read(read => read.Action("Products_Read", "DataSource"))
)
)
@(Html.Kendo().Chart<ProductViewModel>()
.Name("chart")
.DataSource("dataSource1")
.Series(series =>
{
series.Column(model => model.UnitPrice).Name("Price").CategoryField("ProductName");
})
)
Legend(System.Boolean)
Sets the legend visibility.
Parameters
visible System.Boolean
A value indicating whether to show the legend.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(false)
);
ValueAxis(System.Action<Kendo.Mvc.UI.Fluent.ChartValueAxisBuilder<T>>)
Configures the default value axis or adds a new one
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartValueAxisBuilder>
The configurator for the axis
Example (ASPX)
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =>
{
series.Area(new double[] { 3.907, 7.943, 5.848 }).Name("Result 1");
})
.CategoryAxis(axis => axis
.Categories("2002", "2003", "2004")
)
.ValueAxis(axi s=> axis
.MajorUnit(1)
)
)
XAxis(System.Action<Kendo.Mvc.UI.Fluent.ChartXAxisBuilder<T>>)
Configures the default X axis or adds a new one
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartXAxisBuilder>
The configurator for the axis
Example (ASPX)
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =>
{
series.Scatter(new double[][] {
new[] { 6.4, 5.4 },
new[] { 11.7, 2 },
new[] { 25.4, 3 },
new[] { 19.0, 2.0 }
});
})
.XAxis(x => x
.Numeric()
.Max(30)
)
)
YAxis(System.Action<Kendo.Mvc.UI.Fluent.ChartYAxisBuilder<T>>)
Configures the default Y axis or adds a new one
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartYAxisBuilder>
The configurator for the axis
Example (ASPX)
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =>
{
series.Scatter(new double[][] {
new[] { 6.4, 5.4 },
new[] { 11.7, 2 },
new[] { 25.4, 3 },
new[] { 19.0, 2.0 }
});
})
.YAxis(x => x
.Numeric()
.Max(15)
)
)
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
AxisDefaults(System.Action<Kendo.Mvc.UI.Fluent.ChartAxisDefaultsSettingsBuilder<T>>)
The default options for all chart axes. Accepts the options supported by categoryAxis, valueAxis, xAxis and yAxis.
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartAxisDefaultsSettingsBuilder>
The configurator for the axisdefaults setting.
ChartArea(System.Action<Kendo.Mvc.UI.Fluent.ChartChartAreaSettingsBuilder<T>>)
The chart area configuration options. Represents the entire visible area of the chart.
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartChartAreaSettingsBuilder>
The configurator for the chartarea setting.
Legend(System.Action<Kendo.Mvc.UI.Fluent.ChartLegendSettingsBuilder<T>>)
The chart legend configuration options.
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartLegendSettingsBuilder>
The configurator for the legend setting.
PaneDefaults(System.Action<Kendo.Mvc.UI.Fluent.ChartPaneDefaultsSettingsBuilder<T>>)
The default options for all panes.
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartPaneDefaultsSettingsBuilder>
The configurator for the panedefaults setting.
Panes(System.Action<Kendo.Mvc.UI.Fluent.ChartPaneFactory<T>>)
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<Kendo.Mvc.UI.Fluent.ChartPaneFactory>
The configurator for the panes setting.
Pannable(System.Action<Kendo.Mvc.UI.Fluent.ChartPannableSettingsBuilder<T>>)
Specifies if the chart can be panned.
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartPannableSettingsBuilder>
The configurator for the pannable setting.
Pannable
Specifies if the chart can be panned.
Pannable(System.Boolean)
Specifies if the chart can be panned.
Parameters
enabled System.Boolean
Enables or disables the pannable option.
Pdf(System.Action<Kendo.Mvc.UI.Fluent.ChartPdfSettingsBuilder<T>>)
Configures the export settings for the saveAsPDF method.
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartPdfSettingsBuilder>
The configurator for the pdf setting.
PersistSeriesVisibility(System.Boolean)
Specifies if the series visible option should be persisted when changing the dataSource data.
Parameters
value System.Boolean
The value for PersistSeriesVisibility
PersistSeriesVisibility
Specifies if the series visible option should be persisted when changing the dataSource data.
PlotArea(System.Action<Kendo.Mvc.UI.Fluent.ChartPlotAreaSettingsBuilder<T>>)
The plot area configuration options. The plot area is the area which displays the series.
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartPlotAreaSettingsBuilder>
The configurator for the plotarea setting.
Series(System.Action<Kendo.Mvc.UI.Fluent.ChartSeriesFactory<T>>)
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<Kendo.Mvc.UI.Fluent.ChartSeriesFactory>
The configurator for the series setting.
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
Theme(System.String)
The chart theme. This can be either a built-in theme or "sass". When set to "sass" the chart will read the variables from the Sass-based themes. More information on the built-in themes could be found in the Less-based themes article.The supported values are: "sass" - special value, see notes; "black"; "blueopal"; "bootstrap"; "default"; "fiori"; "flat"; "highcontrast"; "material"; "materialblack"; "metro"; "metroblack"; "moonlight"; "nova"; "office365"; "silver" or "uniform".
Parameters
value System.String
The value for Theme
Title(System.Action<Kendo.Mvc.UI.Fluent.ChartTitleSettingsBuilder<T>>)
The chart title configuration options or text.
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartTitleSettingsBuilder>
The configurator for the title setting.
Tooltip(System.Action<Kendo.Mvc.UI.Fluent.ChartTooltipSettingsBuilder<T>>)
The chart series tooltip configuration options.
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartTooltipSettingsBuilder>
The configurator for the tooltip setting.
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
Zoomable(System.Action<Kendo.Mvc.UI.Fluent.ChartZoomableSettingsBuilder<T>>)
Specifies if the chart can be zoomed.
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartZoomableSettingsBuilder>
The configurator for the zoomable setting.
Zoomable
Specifies if the chart can be zoomed.
Zoomable(System.Boolean)
Specifies if the chart can be zoomed.
Parameters
enabled System.Boolean
Enables or disables the zoomable option.
RenderAs(Kendo.Mvc.UI.RenderingMode)
Specifies the preferred widget rendering mode.
Parameters
value Kendo.Mvc.UI.RenderingMode
The value for RenderAs
Events(System.Action<Kendo.Mvc.UI.Fluent.ChartEventBuilder>)
Configures the client-side events.
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartEventBuilder>
The client events action.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Events(events => events
.AxisLabelClick("onAxisLabelClick")
)
)