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

Defines the fluent interface for configuring series.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

TSeries

TSeriesBuilder

The type of the series builder.

Syntax:

C#
public abstract class ChartSeriesBuilderBase<TSeries, TSeriesBuilder> where TSeries : IChartSeries where TSeriesBuilder : ChartSeriesBuilderBase<TSeries, TSeriesBuilder>

Inheritance: objectChartSeriesBuilderBase<TSeries, TSeriesBuilder>

Derived Classes: ChartAreaSeriesBuilderBase<TSeries, TSeriesBuilder>ChartBarSeriesBuilderBase<TSeries, TSeriesBuilder>ChartBoxPlotSeriesBuilder<T>ChartLineSeriesBuilderBase<TSeries, TSeriesBuilder>ChartOHLCSeriesBuilder<T>ChartRangeAreaSeriesBuilder<T>ChartScatterSeriesBuilderBase<TSeries, TBuilder>ChartTrendlineSeriesBuilder<T>...

Inherited Members object.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 ChartSeriesBuilderBase<TSeries, TSeriesBuilder> class.

C#
protected ChartSeriesBuilderBase(TSeries series)
Parameters:seriesTSeries

The series.

Properties

Series

TSeries

Gets or sets the series.

C#
public TSeries Series { get; }
Property Value:

The series.

Methods

Sets the function used to retrieve point color.

C#
public TSeriesBuilder Aggregate(Func<object, object> aggregateFunction)
Parameters:aggregateFunctionFunc<object, object>

The JavaScript function that will be executed to retrieve the value of each aggregated point.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.Bar(s =&gt; s.Sales)
.Aggregate(
@&lt;text&gt;
function(values) {
return values[0];
}
&lt;/text&gt;
)
)
)

Sets the function used to retrieve point color.

C#
public TSeriesBuilder Aggregate(string aggregateFunction)
Parameters:aggregateFunctionstring

The JavaScript function that will be executed to retrieve the value of each aggregated point.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.Bar(s =&gt; s.Sales)
.Aggregate("myAggregate")
)
)
&lt;script&gt;
function myAggregate(values) {
return values[0];
}
&lt;/script&gt;

Sets the axis name to use for this series.

C#
public virtual TSeriesBuilder Axis(string axis)
Parameters:axisstring

The value that sets the axis name for this series.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Name("Sales").Axis("secondary"))
.ValueAxis(axis =&gt; axis.Numeric())
.ValueAxis(axis =&gt; axis.Numeric("secondary"))
.CategoryAxis(axis =&gt; axis.AxisCrossingValue(0, 10))
)

Sets the axis name to use for this series.

C#
public virtual TSeriesBuilder CategoryAxis(string categoryAxis)
Parameters:categoryAxisstring

The value that sets the category axis name for this series.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Name("Sales").CategoryAxis("catAxis"))
.CategoryAxis(axis =&gt; axis.Name("catAxis"))
)

Sets the bar fill color

C#
public TSeriesBuilder Color(string color)
Parameters:colorstring

The value that configures the bar fill color (CSS syntax).

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Color("#aa00bb"))
)

Sets the function used to retrieve point color.

C#
public TSeriesBuilder ColorHandler(Func<object, object> colorFunction)
Parameters:colorFunctionFunc<object, object>

The JavaScript function that will be executed to retrieve the color of each point.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.Bar(s =&gt; s.Sales)
.ColorHandler(
@&lt;text&gt;
function(point) {
return point.value &gt; 5 ? "red" : "green";
}
&lt;/text&gt;
)
)
)

Sets the function used to retrieve point color.

C#
public TSeriesBuilder ColorHandler(string colorFunction)
Parameters:colorFunctionstring

The JavaScript function that will be executed to retrieve the color of each point.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.Bar(s =&gt; s.Sales)
.ColorHandler("pointColor")
)
)

The data field which contains the value to use to drill down into detailed data for the point.

C#
public TSeriesBuilder DrilldownField(string value)
Parameters:valuestring

The value that sets the DrilldownField

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.Series(series =&gt; {
series.Area(s =&gt; s.Sales).DrilldownField("details");
})

A function that creates the drilldown series for a given point.The function should accept a single parameter, the point drilldownField value. The function should return a series configuration object or a Promise that resolves to one.

C#
public TSeriesBuilder DrilldownSeriesFactory(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.Series(series =&gt; {
series
.Area(s =&gt; s.Sales)
.DrilldownSeriesFactory(
@&lt;text&gt;
function (e) {
//event handler code
}
&lt;/text&gt;
);
})

A function that creates the drilldown series for a given point.The function should accept a single parameter, the point drilldownField value. The function should return a series configuration object or a Promise that resolves to one.

C#
public TSeriesBuilder DrilldownSeriesFactory(string handler)
Parameters:handlerstring

The name of the JavaScript function that will be evaluated.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.Series(series =&gt; {
series.Area(s =&gt; s.Sales).DrilldownSeriesFactory("drilldownByModel");
})

The legend focus highlight configuration options.

C#
public TSeriesBuilder FocusHighlight(Action<ChartSeriesFocusHighlightSettingsBuilder> configurator)
Parameters:configuratorAction<ChartSeriesFocusHighlightSettingsBuilder>

The configurator for the focus highlight setting.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.SeriesDefaults(s=&gt;s.Pie().FocusHighlight(f=&gt;
f.Border(b=&gt;b
.Width(4)
.Color("green")
.DashType(ChartDashType.LongDash)
.Opacity(0.7)
)
))
)

Configures the series highlight

C#
public TSeriesBuilder Highlight(Action<ChartSeriesHighlightBuilder> configurator)
Parameters:configuratorAction<ChartSeriesHighlightBuilder>

Use the configurator to set highlight options.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series.Pie(s =&gt; s.Sales, s =&gt; s.DateString)
.Highlight(highlight =&gt; highlight.Color("yellow"))
)
)

Configures the highlight visibility

C#
public TSeriesBuilder Highlight(bool visible)
Parameters:visiblebool

The value that sets the highlight visibility.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series.Pie(s =&gt; s.Sales, s =&gt; s.DateString)
.Highlight(false)
)
)

The chart series legend configuration options.

C#
public TSeriesBuilder LegendItem(Action<ChartSeriesLegendItemSettingsBuilder> configurator)
Parameters:configuratorAction<ChartSeriesLegendItemSettingsBuilder>

Use the configurator to set series legend options.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.Series(series =&gt; {
series
.Area(s =&gt; s.Sales)
.LegendItem(l =&gt; l.Type("area"))
})

The configuration of the Box Plot mean value indicator (line).

C#
public TSeriesBuilder Mean(Action<ChartSeriesMeanBuilder> configurator)
Parameters:configuratorAction<ChartSeriesMeanBuilder>

Use the configurator to set mean options.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.Series(series =&gt; {
series.Area(s =&gt; s.Sales).Mean(m =&gt; {
m.Color("red");
});
series.Column(s =&gt; s.Price).Mean(m =&gt; {
m.Color("red");
});
})
)

The configuration of the Box Plot median value indicator (line).

C#
public TSeriesBuilder Median(Action<ChartSeriesMedianBuilder> configurator)
Parameters:configuratorAction<ChartSeriesMedianBuilder>

Use the configurator to set median options.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.Series(series =&gt; {
series.Area(s =&gt; s.Sales).Median(m =&gt; {
m.Color("red");
});
series.Column(s =&gt; s.Price).Median(m =&gt; {
m.Color("red");
});
})
)

Sets the series title displayed in the legend.

C#
public TSeriesBuilder Name(string text)
Parameters:textstring

The value that sets the title.

Returns:

TSeriesBuilder

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

Configures the series notes

C#
public TSeriesBuilder Notes(Action<ChartNoteBuilder> configurator)
Parameters:configuratorAction<ChartNoteBuilder>

Use the configurator to set notes options.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.Series(series =&gt; series
.Bar(s =&gt; s.Sales).Notes(notes =&gt; notes.Position(ChartNotePosition.Right))
)
)

Sets the series opacity.

C#
public TSeriesBuilder Opacity(double opacity)
Parameters:opacitydouble

The value that sets the series opacity in the range from 0 (transparent) to 1 (opaque). The default value is 1.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Opacity(0.5))
)

The chart series pattern configuration options.

C#
public TSeriesBuilder Pattern(Action<ChartSeriesPatternSettingsBuilder> configurator)
Parameters:configuratorAction<ChartSeriesPatternSettingsBuilder>

The configurator for the Pattern setting.

Returns:

TSeriesBuilder

Configure the data point tooltip for the series.

C#
public TSeriesBuilder Tooltip(Action<ChartTooltipBuilder> configurator)
Parameters:configuratorAction<ChartTooltipBuilder>

Use the configurator to set tooltip options.

Returns:

TSeriesBuilder

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

Sets the data point tooltip visibility.

C#
public TSeriesBuilder Tooltip(bool visible)
Parameters:visiblebool

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

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Tooltip(true))
)

Sets the labels visibility

C#
public TSeriesBuilder Visible(bool visible)
Parameters:visiblebool

The value that sets the labels visibility.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Visible(false))
)

Sets the labels visibility in the legend

C#
public TSeriesBuilder VisibleInLegend(bool visible)
Parameters:visiblebool

The value that configures the series visibility in the legend.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).VisibleInLegend(false))
)

Sets the series stacking order relative to other series.

C#
public TSeriesBuilder ZIndex(double zIndex)
Parameters:zIndexdouble

The stacking order of series, relative to other series. The series with the highest Z-index will be placed on top.

Series with no Z-index will use the default stacking order based on series type. For example line series will be on top with bar and area following below.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.Series(series =&gt; {
series.Area(s =&gt; s.Sales).ZIndex(2);
series.Column(s =&gt; s.Price).ZIndex(1);
})
)