ChartDateCategoryAxisBuilder
Properties
Container - Chart
Gets or sets the data to display in the Chart.
Axis - IChartDateCategoryAxis
The categories displayed on the axis
Methods
Categories(System.Linq.Expressions.Expression)
Defines bound categories.
Parameters
expression - System.Linq.Expressions.Expression<Func>
The expression used to extract the categories value from the chart model
Categories(System.Collections.Generic.IEnumerable)
Defines categories.
Parameters
categories - System.Collections.Generic.IEnumerable<DateTime>
The list of categories
Example
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis => axis
.Date().Categories(Model.Categories)
)
)
Categories(System.DateTime[])
Defines categories.
Parameters
categories - System.DateTime[]
The list of categories
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Date().Categories(DateTime.Now, DateTime.Now.AddDays(1), DateTime.Now.AddDays(2))
)
)
BaseUnit(Kendo.Mvc.UI.ChartAxisBaseUnit)
Sets the date category axis base unit.
Parameters
baseUnit - ChartAxisBaseUnit
The date category axis base unit
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Date().BaseUnit(ChartAxisBaseUnit.Days)
)
)
BaseUnitStep(System.Int32)
Sets the step (interval) between categories in base units. Specifiying 0 (auto) will set the step to such value that the total number of categories does not exceed MaxDateGroups.
Parameters
baseUnitStep - System.Int32
the step (interval) between categories in base units. Set 0 for automatic step. The default value is 1.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Date().BaseUnit(ChartAxisBaseUnit.Days).BaseUnitStep(7)
)
)
MaxDateGroups(System.Int32)
Specifies the maximum number of groups (categories) that the chart will attempt to produce when either BaseUnit is set to Fit or BaseUnitStep is set to 0 (auto). This option is ignored in all other cases.
Parameters
maxDateGroups - System.Int32
the maximum number of groups (categories). The default value is 10.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Date().BaseUnit(ChartAxisBaseUnit.Days).MaxDateGroups(30)
)
)
MaxDivisions(System.Double)
The maximum number of ticks and labels to display. Applicabable for date category axis.
Parameters
value - System.Double
The value for MaxDivisions
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Date().MaxDivisions(100)
)
)
RoundToBaseUnit(System.Boolean)
If set to false, the min and max dates will not be rounded off to the nearest baseUnit. This option is most useful in combination with explicit min and max dates. It will be ignored if either Bar, Column, OHLC or Candlestick series are plotted on the axis.
Parameters
roundToBaseUnit - System.Boolean
A boolean value that indicates if the axis range should be rounded to the nearest base unit. The default value is true.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Date().RoundToBaseUnit(false)
)
)
WeekStartDay(System.DayOfWeek)
Sets the week start day.
Parameters
weekStartDay - System.DayOfWeek
The week start day when the base unit is Weeks. The default is Sunday.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Date().WeekStartDay(DayOfWeek.Monday)
)
)
Justify(System.Boolean)
Positions categories and series points on major ticks. This removes the empty space before and after the series. This option will be ignored if either Bar, Column, OHLC or Candlestick series are plotted on the axis.
Parameters
justified - System.Boolean
A boolean value that indicates if the empty space before and after the series should be removed. The default value is false.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Date().Justify(true)
)
)
Justify()
Positions categories and series points on major ticks. This removes the empty space before and after the series. This option will be ignored if either Bar, Column, OHLC or Candlestick series are plotted on the axis.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Date().Justify(true)
)
)
AutoBaseUnitSteps(System.Action)
Specifies the discrete baseUnitStep values when either BaseUnit is set to Fit or BaseUnitStep is set to 0 (auto).
Parameters
configurator - System.Action<ChartAxisBaseUnitStepsBuilder>
The configuration action.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Date().AutoBaseUnitSteps(steps => steps.Days(1, 5, 10))
)
)
Min(System.DateTime)
Sets the date category axis minimum (start) date.
Parameters
min - System.DateTime
The date category axis minimum (start) date
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Date().Min(DateTime.Now)
)
)
Max(System.DateTime)
Sets the date category axis maximum (end) date.
Parameters
max - System.DateTime
The date category axis maximum (end) date
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Date().Max(DateTime.Now)
)
)
AxisCrossingValue(System.Double)
Sets value at which the first perpendicular axis crosses this axis.
Parameters
axisCrossingValue - System.Double
The value at which the first perpendicular axis crosses this axis.
Example
@(Html.Kendo().Chart(Model)
.Name("Chart")
.CategoryAxis(axis => axis.Date().AxisCrossingValue(4))
.ValueAxis(axis => axis.Numeric().Title("Axis 1"))
.ValueAxis(axis => axis.Numeric("secondary").Title("Axis 2"))
)
AxisCrossingValue(System.Double[])
Sets value at which perpendicular axes cross this axis.
Parameters
axisCrossingValues - System.Double[]
The values at which perpendicular axes cross this axis.
Example
@(Html.Kendo().Chart(Model)
.Name("Chart")
.CategoryAxis(axis => axis.Date().AxisCrossingValue(0, 10))
.ValueAxis(axis => axis.Numeric().Title("Axis 1"))
.ValueAxis(axis => axis.Numeric("secondary").Title("Axis 2"))
)
AxisCrossingValue(System.Collections.Generic.IEnumerable)
Sets value at which perpendicular axes cross this axis.
Parameters
axisCrossingValues - System.Collections.Generic.IEnumerable<Double>
The values at which perpendicular axes cross this axis.
Example
@(Html.Kendo().Chart(Model)
.Name("Chart")
.CategoryAxis(axis => axis.Date().AxisCrossingValue(new double[] { 0, 10 }))
.ValueAxis(axis => axis.Numeric().Title("Axis 1"))
.ValueAxis(axis => axis.Numeric("secondary").Title("Axis 2"))
)
Labels(System.Action)
Configures the axis labels.
Parameters
configurator - System.Action<ChartDateAxisLabelsBuilder>
The configuration action.
Example
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis => axis
.Date()
.Labels(labels => labels
.Culture(new CultureInfo("es-ES"))
.Visible(true)
)
)
)
Labels(System.Action)
Configures the axis labels.
Parameters
configurator - System.Action<ChartAxisLabelsBuilder>
The configuration action.
Example
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis => axis
.Date()
.Labels(labels => labels
.Culture(new CultureInfo("es-ES"))
.Visible(true)
)
)
)
Select(System.Nullable,System.Nullable)
Sets the selection range
Parameters
from - System.Nullable<DateTime>
The selection range start.
to - System.Nullable<DateTime>
The selection range end. Note: The specified date is not included in the selected range unless the axis is justified. In order to select all categories specify a value larger than the last date.
Example
@(Html.Kendo().Chart(Model)
.Name("Chart")
.CategoryAxis(axis => axis.Select(DateTime.Today.AddMonths(-1), DateTime.Today))
)
Select(System.Action)
Configures the selection
Parameters
configurator - System.Action<ChartAxisSelectionBuilder>
The configuration action.
Example
@(Html.Kendo().Chart(Model)
.Name("Chart")
.CategoryAxis(axis => axis.Select(select =>
select.Mousewheel(mw => mw.Reverse())
))
)
Notes(System.Action)
Defines the items.
Parameters
configurator - System.Action<ChartAxisNotesBuilder>
The items of the notes.
Example
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(a => a.Numeric()
.Note(note => note
.Data(data =>
{
data.Add().Value(1);
data.Add().Value(2);
})
)
)
)
MajorTicks(System.Action)
Configures the axis major ticks.
Parameters
configurator - System.Action<ChartAxisTicksBuilder>
The action that configures the major ticks options.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.MajorTicks(m => m.Visible(false))
)
)
Crosshair(System.Action)
Defines the crosshair configuration options.
Parameters
configurator - System.Action<ChartAxisCrosshairBuilder>
The action that configures the crosshair settings.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Crosshair(c => c.Visible(true).Color("green"))
)
)
Name(System.String)
Sets the axis name.
Parameters
name - System.String
The value that configures the axis name.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis.Name("year-axis"))
)
MinorTicks(System.Action)
Configures the axis minor ticks.
Parameters
configurator - System.Action<ChartAxisTicksBuilder>
The action that configures the minor ticks options.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.MinorTicks(m => m.Visible(false))
)
)
MajorGridLines(System.Action)
Configures the axis major grid lines. These lines are an extension of the major ticks through the body of the chart.
Parameters
configurator - System.Action<ChartMajorGridLinesBuilder>
The action that configures the major grid lines options.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.MajorGridLines(lines => lines.Visible(true))
)
)
MajorGridLines(System.Int32,System.String,Kendo.Mvc.UI.ChartDashType)
Sets the width, color, and dash type of the major grid lines and enables them. These lines are an extension of the major ticks through the body of the chart.
Parameters
width - System.Int32
The value of the width.
color - System.String
The value of the color (CSS syntax).
dashType - ChartDashType
The enum value that defines the dash type.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.MajorGridLines(2, "red", ChartDashType.Dot)
)
)
MinorGridLines(System.Action)
Configures the axis minor grid lines. These lines are an extension of the minor ticks through the body of the chart.
Parameters
configurator - System.Action<ChartMinorGridLinesBuilder>
The action that configures the minor grid lines options.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.MinorGridLines(lines => lines.Visible(true))
)
)
MinorGridLines(System.Int32,System.String,Kendo.Mvc.UI.ChartDashType)
Sets the width, color, and dash type of the minor grid lines and enables them. These lines are an extension of the minor ticks through the body of the chart.
Parameters
width - System.Int32
The value of the width.
color - System.String
The value of the color (CSS syntax).
dashType - ChartDashType
The enum value that defines the dash type.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.MinorGridLines(2, "red", ChartDashType.Dot)
)
)
Line(System.Action)
Defines the configuration of the axis lines. The line settings also affect the major and minor ticks but not the grid lines.
Parameters
configurator - System.Action<ChartLineBuilder>
The action that configures the lines options.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Line(line => line.Color("#f00"))
)
)
Line(System.Int32,System.String,Kendo.Mvc.UI.ChartDashType)
Sets the width, color, and dash type of the lines and enables them. The line settings also affect the major and minor ticks but not the grid lines.
Parameters
width - System.Int32
The value of the width.
color - System.String
The value of the color (CSS syntax).
dashType - ChartDashType
The enum value that defines the dash type.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Line(2, "#f00", ChartDashType.Dot)
)
)
Labels(System.Boolean)
Sets the visibility of axis labels. By default, the labels are visible.
Parameters
visible - System.Boolean
The option that toggles the visibility of the labels.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis.Labels(false))
)
PlotBands(System.Action)
Defines the plot bands of the axis.
Parameters
configurator - System.Action<ChartAxisPlotBandsFactory>
The action that configures the plot bands options.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.PlotBands(bands =>
{
bands.Add().From(0).To(4).Color("lightgreen");
bands.Add().From(4).To(10).Color("lightblue");
})
)
)
Title(System.Action)
Defines the title configuration of the axis.
Parameters
configurator - System.Action<ChartAxisTitleBuilder>
The action that configures the title settings.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Title(title => title.Text("Category").Background("yellow"))
)
)
Title(System.String)
Sets the text of the axis title.
Parameters
title - System.String
The value that configures the text of the title.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis.Title("Category Axis"))
)
Pane(System.String)
Defines the name of the pane that the axis must be rendered in. The axis will be rendered in the first (default) pane if not set.
Parameters
pane - System.String
The value that configures the name of the pane.
Example
@(Html.Kendo().Chart()
.Name("chart")
.Panes(panes => {
panes.Add().Title("Value");
panes.Add("volumePane").Title("Volume");
})
.CategoryAxis(axis => axis
.Pane("volumePane")
)
)
Color(System.String)
Sets the color for all axis elements. It can be overridden by the individual settings (Labels or Lines).
Parameters
color - System.String
The value of the color.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Color("#ff0000")
)
)
Reverse(System.Boolean)
If set to "true", the axis direction will be reversed.
Parameters
reverse - System.Boolean
A value indicating if the axis labels must be rendered in reverse.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Reverse(true)
)
)
Reverse()
If set to "true", the axis direction will be reversed.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Reverse(true)
)
)
Visible(System.Boolean)
Sets the visibility of the axis.
Parameters
visible - System.Boolean
The option that toggles the visibility of the axis.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Visible(false)
)
)
StartAngle(System.Double)
Defines the angle (degrees) where the first axis value is placed. The angles increase clockwise and zero is to the left. The negative values are acceptable.
Parameters
startAngle - System.Double
The start angle value.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.StartAngle(180)
)
)
NarrowRange(System.Boolean)
If set to "true", the Chart will narrow the value axis range to display data points in detail. When the option is disabled, the Chart will force the automatic axis range to start from 0 or the explicitly specified.
Parameters
narrowRange - System.Boolean
The value that enables or disables the NarrowRange option.
Example
@(Html.Kendo().Chart()
.Name("chart")
.ValueAxis(axis => axis
.Numeric()
.NarrowRange(false)
)
)
Background(System.String)
Sets the background color of the axis.
Parameters
background - System.String
The value that configures the background color.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis.Background("#ff0000"))
)
RangeLabels(System.Action)
Defines the configuration of the range labels of the date axis.
Parameters
configurator - System.Action<ChartAxisRangeLabelsBuilder>
The action that configures the range labels settings.
Example
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis => axis
.Date()
.RangeLabels(labels => labels.Color("green").Visible(true))
)
)