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

Defines the fluent interface for configuring Bar series.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

TSeries

TSeriesBuilder

Syntax:

C#
public class ChartBarSeriesBuilderBase<TSeries, TSeriesBuilder> : ChartSeriesBuilderBase<TSeries, TSeriesBuilder> where TSeries : IBarSeries where TSeriesBuilder : ChartBarSeriesBuilderBase<TSeries, TSeriesBuilder>

Inheritance: objectChartSeriesBuilderBase<TSeries, TSeriesBuilder>ChartBarSeriesBuilderBase<TSeries, TSeriesBuilder>

Derived Classes: ChartBarSeriesBuilder<T>ChartRadarColumnSeriesBuilder<T>ChartRangeBarSeriesBuilder<T>ChartWaterfallSeriesBuilder<T>

Inherited Members ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Name(string)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Opacity(double)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Color(string)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.ColorHandler(Func<object, object>)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.ColorHandler(string)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Tooltip(Action<ChartTooltipBuilder>)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Tooltip(bool)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Axis(string)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.CategoryAxis(string)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Highlight(Action<ChartSeriesHighlightBuilder>)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.FocusHighlight(Action<ChartSeriesFocusHighlightSettingsBuilder>)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Highlight(bool)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Visible(bool)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.VisibleInLegend(bool)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Notes(Action<ChartNoteBuilder>)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Aggregate(Func<object, object>)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Aggregate(string)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.ZIndex(double)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Median(Action<ChartSeriesMedianBuilder>)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Mean(Action<ChartSeriesMeanBuilder>)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.DrilldownField(string)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.DrilldownSeriesFactory(string)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.DrilldownSeriesFactory(Func<object, object>)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.LegendItem(Action<ChartSeriesLegendItemSettingsBuilder>)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Pattern(Action<ChartSeriesPatternSettingsBuilder>)ChartSeriesBuilderBase<TSeries, TSeriesBuilder>.Seriesobject.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 ChartBarSeriesBuilderBase<TSeries, TSeriesBuilder> class.

C#
public ChartBarSeriesBuilderBase(TSeries series)
Parameters:seriesTSeries

The series.

Methods

Sets the aggregate function for Date series. This function is used when a category (an year, month, etc.) contains two or more points.

C#
public virtual TSeriesBuilder Aggregate(ChartSeriesAggregate aggregate)
Parameters:aggregateChartSeriesAggregate

The aggregate function name.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart&lt;ChartViewModel&gt;()
.Name("chart")
.Series(series =&gt; series.Bar(model =&gt; model.Value, model =&gt; model.Date).Aggregate(ChartSeriesAggregate.Avg))
)

Configures the border of the series.

C#
public TSeriesBuilder Border(Action<ChartBorderBuilder> configurator)
Parameters:configuratorAction<ChartBorderBuilder>

The action that configures the border settings.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart&lt;ChartViewModel&gt;()
.Name("Chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Border(b =&gt; b.Width(1).Color("green")))
)

Sets the border of the chart series.

C#
public TSeriesBuilder Border(int width, string color, ChartDashType dashType)
Parameters:widthint

The border width.

colorstring

The border color (CSS syntax).

dashTypeChartDashType

The border dash type.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart&lt;ChartViewModel&gt;()
.Name("Chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Border(1, "#000", ChartDashType.Dot))
)

Sets the Model property that holds the category name or date.

C#
public TSeriesBuilder CategoryField(string categoryField)
Parameters:categoryFieldstring

The name of the Model property.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart&lt;ChartViewModel&gt;()
.Name("Chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Field("Total").CategoryField("Year"))
)

Sets the Model property that holds the series color.

C#
public TSeriesBuilder ColorField(string colorField)
Parameters:colorFieldstring

The name of the Model property.

Returns:

TSeriesBuilder

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

Sets the Model property that holds the series value.

C#
public TSeriesBuilder Field(string field)
Parameters:fieldstring

The name of the Model property.

Returns:

TSeriesBuilder

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

Sets the distance between category clusters.

A value of 1 means that there is a total of 1 column width / bar height between categories. The distance is distributed evenly on each side. The default value is 1.5
C#
public TSeriesBuilder Gap(double gap)
Parameters:gapdoubleReturns:

TSeriesBuilder

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

Configures the Bar Chart labels.

C#
public virtual TSeriesBuilder Labels(Action<ChartBarLabelsBuilder> configurator)
Parameters:configuratorAction<ChartBarLabelsBuilder>

The action that configures the labels settings.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.Series(series =&gt; series
.Bar(s =&gt; s.Sales)
.Labels(labels =&gt; labels
.Position(ChartBarLabelsPosition.InsideEnd)
.Visible(true)
)
)
)

Sets the visibility of Bar Chart labels.

C#
public virtual TSeriesBuilder Labels(bool visible)
Parameters:visiblebool

The value that sets the visibility of the labels.

Returns:

TSeriesBuilder

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

Sets the bar color for negative values.

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

The color value (CSS syntax).

Returns:

TSeriesBuilder

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

Sets the Model property that holds the series note text.

C#
public TSeriesBuilder NoteTextField(string noteTextField)
Parameters:noteTextFieldstring

The name of the Model property.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart&lt;ChartViewModel&gt;()
.Name("Chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Field("Total").NoteTextField("NoteText"))
)

Sets the series effects overlay.

C#
public TSeriesBuilder Overlay(ChartBarSeriesOverlay overlay)
Parameters:overlayChartBarSeriesOverlay

The enum value that sets the overlay. The default is ChartBarSeriesOverlay.Glass

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart&lt;ChartViewModel&gt;()
.Name("Chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Overlay(ChartBarSeriesOverlay.None))
)

Sets a value indicating the distance between series points within a category.

C#
public TSeriesBuilder Spacing(double spacing)
Parameters:spacingdouble

Value of 1 means that the distance between bars is equal to their width. The default value is 0

Returns:

TSeriesBuilder

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

Indicates if the series must be stacked.

C#
public virtual TSeriesBuilder Stack(bool stacked)
Parameters:stackedbool

A value that enables/disables the Stack option.

Returns:

TSeriesBuilder

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

Configures the stack that the series belongs to.

C#
public virtual TSeriesBuilder Stack(ChartStackType stackType, string stackGroup = null)
Parameters:stackTypeChartStackType

The stack type.

stackGroupstring

The name of the stack group.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart&lt;ChartViewModel&gt;()
.Name("chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Stack(ChartStackType.Stack100, "Female"))
)

Sets the name of the stack that this series belongs to. Each unique name creates a new stack.

C#
public virtual TSeriesBuilder Stack(string stackGroup)
Parameters:stackGroupstring

The name of the stack group.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart&lt;ChartViewModel&gt;()
.Name("chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Stack("Female"))
)

Sets a handler that creates a custom visual for the points.

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

The handler code wrapped in a text tag (Razor syntax).

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =&gt;
{
series.Column(new double[] { 52000, 34000, 23000, 48000, 67000, 83000 }).Name("Unique visitors").Visual(
@&lt;text&gt;
function(e) {
var origin = e.rect.origin;
var center = e.rect.center();
var bottomRight = e.rect.bottomRight();

var path = new kendo.drawing.Path({
fill: {
color: e.options.color
}
})
.moveTo(origin.x, bottomRight.y)
.lineTo(bottomRight.x, bottomRight.y)
.lineTo(center.x, origin.y)
.close();

return path;
}
&lt;/text&gt;
);
})
)

Sets a JavaScript function that creates a custom visual for the points.

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

The name of the JavaScript function.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart&lt;ChartViewModel&gt;()
.Name("Chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Field("Total").Visual("getSeriesVisual"))
)

Defines the whiskers configuration of the chart series.

C#
public TSeriesBuilder Whiskers(Action<ChartSeriesWhiskersSettingsBuilder> configurator)
Parameters:configuratorAction<ChartSeriesWhiskersSettingsBuilder>

The action that configures the whiskers settings.

Returns:

TSeriesBuilder

Example:
C#
@(Html.Kendo().Chart&lt;ChartViewModel&gt;()
.Name("Chart")
.Series(series =&gt; series.Bar(s =&gt; s.Sales).Whiskers(w =&gt; w.Color("#0000FF")))
)