yAxis.labels Object
The axis labels configuration.
Example - set the scatter chart y axis labels
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
background: "green",
color: "white"
}
}
});
</script>
yAxis.labels.background String
The background color of the labels. Accepts a valid CSS color string, including hex and rgb.
Example - set the scatter chart y axis label background as a hex string
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
background: "#aa00bb"
}
}
});
</script>
Example - set the scatter chart y axis label background as a RGB value
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
background: "rgb(128, 0, 255)"
}
}
});
</script>
Example - set the scatter chart y axis label background by name
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
background: "red"
}
}
});
</script>
yAxis.labels.border Object
The border of the labels.
Example - set the scatter chart y axis label border
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
border: {
width: 1,
color: "green",
dashType: "dashDot"
}
}
}
});
</script>
yAxis.labels.border.color String
(default: "black")
The color of the border. Accepts a valid CSS color string, including hex and rgb.
Example - set the scatter chart y axis label color
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
border: {
width: 1,
color: "green"
}
}
}
});
</script>
yAxis.labels.border.dashType String
(default: "solid")
The dash type of the border.
The following dash types are supported:
- "dash" - a line consisting of dashes
- "dashDot" - a line consisting of a repeating pattern of dash-dot
- "dot" - a line consisting of dots
- "longDash" - a line consisting of a repeating pattern of long-dash
- "longDashDot" - a line consisting of a repeating pattern of long-dash-dot
- "longDashDotDot" - a line consisting of a repeating pattern of long-dash-dot-dot
- "solid" - a solid line
Example - set the scatter chart y axis label border dash type
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
border: {
width: 1,
dashType: "dashDot"
}
}
}
});
</script>
yAxis.labels.border.width Number
(default: 0)
The width of the border in pixels. By default the border width is set to zero which means that the border will not appear.
Example - set the scatter chart y axis label border dash type
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
border: {
width: 1
}
}
}
});
</script>
yAxis.labels.color String
The text color of the labels. Accepts a valid CSS color string, including hex and rgb.
Example - set the scatter chart y axis label color as a hex string
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
color: "#aa00bb"
}
}
});
</script>
Example - set the scatter chart y axis label color as a RGB value
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
color: "rgb(128, 0, 255)"
}
}
});
</script>
Example - set the scatter chart y axis label color by name
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
color: "red"
}
}
});
</script>
yAxis.labels.culture String
The culture to use when formatting date values. See the globalization overview for more information.
yAxis.labels.dateFormats Object
The format used to display the labels when the x values are dates. Uses kendo.format. Contains one placeholder ("{0}") which represents the category value.
The chart will choose the appropriate format for the current yAxis.baseUnit. Setting the categoryAxis.labels.format option will override the date formats.
Example - set the scatter chart y axis date formats
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{
type: "scatter",
data: [
[2, new Date("01/01/2013")],
[2, new Date("01/02/2013")],
[2, new Date("01/03/2013")]
]
}
],
yAxis: {
type: "date",
labels: {
dateFormats: {
days: "M-d"
}
}
}
});
</script>
yAxis.labels.dateFormats.days String
(default: "M/d")
The format used when yAxis.baseUnit is set to "days".
Example - set the days format
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{
type: "scatter",
data: [
[2, new Date("01/01/2013")],
[2, new Date("01/02/2013")],
[2, new Date("01/03/2013")]
]
}
],
yAxis: {
type: "date",
baseUnit: "days",
labels: {
dateFormats: {
days: "M-d"
}
}
}
});
</script>
yAxis.labels.dateFormats.hours String
(default: "HH:mm")
The format used when yAxis.baseUnit is set to "hours".
Example - set the hours format
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{
type: "scatter",
data: [
[2, new Date("01/01/2013")],
[2, new Date("01/02/2013")],
[2, new Date("01/03/2013")]
]
}
],
yAxis: {
type: "date",
baseUnit: "hours",
labels: {
dateFormats: {
hours: "HH mm"
}
}
}
});
</script>
yAxis.labels.dateFormats.months String
(default: "MMM 'yy")
The format used when yAxis.baseUnit is set to "months".
Example - set the months format
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{
type: "scatter",
data: [
[2, new Date("01/01/2013")],
[2, new Date("01/02/2013")],
[2, new Date("01/03/2013")]
]
}
],
yAxis: {
type: "date",
baseUnit: "months",
labels: {
dateFormats: {
months: "MMM-yy"
}
}
}
});
</script>
yAxis.labels.dateFormats.weeks String
(default: "M/d")
The format used when yAxis.baseUnit is set to "weeks".
Example - set the weeks format
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{
type: "scatter",
data: [
[2, new Date("01/01/2013")],
[2, new Date("01/02/2013")],
[2, new Date("01/03/2013")]
]
}
],
yAxis: {
type: "date",
baseUnit: "weeks",
labels: {
dateFormats: {
weeks: "M-d"
}
}
}
});
</script>
yAxis.labels.dateFormats.years String
(default: "yyyy")
The format used when yAxis.baseUnit is set to "years".
Example - set the years format
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{
type: "scatter",
data: [
[2, new Date("01/01/2013")],
[2, new Date("01/02/2013")],
[2, new Date("01/03/2013")]
]
}
],
yAxis: {
type: "date",
baseUnit: "years",
labels: {
dateFormats: {
years: "yy"
}
}
}
});
</script>
yAxis.labels.font String
(default: "12px Arial,Helvetica,sans-serif")
The font style of the labels. Accepts a valid CSS color string, for example "20px 'Courier New'".
Example - set the scatter chart y axis label font
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
font: "20px sans-serif"
}
}
});
</script>
yAxis.labels.format String
The format used to display the labels. Uses kendo.format. Contains one placeholder ("{0}") which represents the category value.
Example - set the scatter chart y axis label format
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
format: "{0:C}"
}
}
});
</script>
yAxis.labels.margin Number|Object
(default: 0)
The margin of the labels. A numeric value will set all margins.
Example - set the scatter chart y axis label margin
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
margin: 10
}
}
});
</script>
yAxis.labels.margin.bottom Number
(default: 0)
The bottom margin of the labels.
Example - set the scatter chart y axis label bottom margin
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
margin: {
bottom: 10
}
}
}
});
</script>
yAxis.labels.margin.left Number
(default: 0)
The left margin of the labels.
Example - set the scatter chart y axis label left margin
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
margin: {
left: 10
}
}
}
});
</script>
yAxis.labels.margin.right Number
(default: 0)
The right margin of the labels.
Example - set the scatter chart y axis label right margin
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
margin: {
right: 10
}
}
}
});
</script>
yAxis.labels.margin.top Number
(default: 0)
The top margin of the labels.
Example - set the scatter chart y axis label top margin
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
margin: {
top: 10
}
}
}
});
</script>
yAxis.labels.mirror Boolean
If set to true
the chart will mirror the axis labels and ticks. If the labels are normally on the left side of the axis, mirroring the axis will render them to the right.
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
mirror: true
}
}
});
</script>
yAxis.labels.padding Number|Object
(default: 0)
The padding of the labels. A numeric value will set all paddings.
Example - set the scatter chart y axis label padding
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
padding: 10
}
}
});
</script>
yAxis.labels.padding.bottom Number
(default: 0)
The bottom padding of the labels.
Example - set the scatter chart y axis label bottom padding
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
padding: {
bottom: 10
}
}
}
});
</script>
yAxis.labels.padding.left Number
(default: 0)
The left padding of the labels.
Example - set the scatter chart y axis label left padding
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
padding: {
left: 10
}
}
}
});
</script>
yAxis.labels.padding.right Number
(default: 0)
The right padding of the labels.
Example - set the scatter chart y axis label right padding
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
padding: {
right: 10
}
}
}
});
</script>
yAxis.labels.padding.top Number
(default: 0)
The top padding of the labels.
Example - set the scatter chart y axis label top padding
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
padding: {
top: 10
}
}
}
});
</script>
yAxis.labels.position String
(default: "onAxis")
The position of the axis labels. By default, labels are positioned next to the axis.
- When
position
is set toend
, the labels are placed at the end of the crossing axis— typically, at the top or right end of the Chart unless the crossing axis was reversed. - When
position
is set tostart
, the labels are placed at the start of the crossing axis— typically, at the left or bottom end of the Chart unless the crossing axis was reversed.
Example - position the Y axis labels at the end of the X axis
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
position: 'end'
}
}
});
</script>
yAxis.labels.rotation Number|Object
(default: 0)
The rotation angle of the labels. By default the labels are not rotated.
Example - set the scatter chart y axis label rotation
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
rotation: 90
}
}
});
</script>
yAxis.labels.rotation.align String
(default: "end")
The alignment of the rotated labels relative to the slot center. The supported values are "end"
and "center"
. By default the closest end of the label will be aligned to the center. If set to "center"
, the center of the rotated label will be aligned instead.
Example - align the rotated x axis labels center
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{
type: "scatter",
data: [
[2, new Date("01/01/2013")],
[2, new Date("01/02/2013")],
[2, new Date("01/03/2013")]
]
}
],
yAxis: {
type: "date",
labels: {
rotation: {
angle: -45,
align: "center"
}
}
}
});
</script>
yAxis.labels.rotation.angle Number
(default: 0)
The rotation angle of the labels. By default the labels are not rotated.
yAxis.labels.skip Number
(default: 1)
The number of labels to skip.
Example - skip scatter chart y axis labels
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
skip: 2
}
}
});
</script>
yAxis.labels.step Number
(default: 1)
The label rendering step - render every n-th label. By default every label is rendered.
Example - render every odd y axis label
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ type: "scatter", data: [[1, 2]] }
],
yAxis: {
labels: {
step: 2
}
}
});
</script>
yAxis.labels.template String|Function
The template which renders the labels.
The fields which can be used in the template are:
- value - the category value
The text can be split into multiple lines by using line feed characters ("\n").
Example - set the scatter chart y axis label template as a string
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{
type: "scatter",
data: [ [1, 2] ]
}
],
yAxis: {
labels: {
template: "X: #: value #"
}
}
});
</script>
Example - set the scatter chart y axis label template as a function
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{
type: "scatter",
data: [ [1, 2] ]
}
],
yAxis: {
labels: {
template: kendo.template("X: #: value #")
}
}
});
</script>
yAxis.labels.visible Boolean
(default: true)
If set to true
the chart will display the y axis labels. By default the y axis labels are visible.
Example - hide the scatter chart y axis labels
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{
type: "scatter",
data: [ [1, 2] ]
}
],
yAxis: {
labels: {
visible: false
}
}
});
</script>
yAxis.labels.visual Function
A function that can be used to create a custom visual for the labels. The available argument fields are:
- createVisual - a function that can be used to get the default visual.
- culture - the default culture (if set) on the label
- format - the default format of the label
- options - the label options.
- rect - the
kendo.geometry.Rect
that defines where the visual should be rendered. - sender - the chart instance (may be undefined).
- text - the label text.
- value - the category value
Example - using custom visual for the labels
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{
type: "scatter",
data: [ [1, 2] ]
}
],
yAxis: {
labels: {
visual: function(e) {
return new kendo.drawing.Text(e.text, e.rect.origin, {
fill: {
color: "red"
}
});
}
}
}
});
</script>