New to Kendo UI for jQuery? Start a free 30-day trial

The axis labels configuration.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [{
            date: new Date("2016/01/01"),
            open: 41.62,
            high: 41.69,
            low: 39.81,
            close: 40.12,
            volume: 2632000
        }]
    },
    navigator: {
        categoryAxis: {
            labels: {
                color: "red",
                font: "12px Arial"
            }
        }
    }
});
</script>

The background color of the labels. Accepts a valid CSS color string, including hex and rgb.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [{
            date: new Date("2016/01/01"),
            open: 41.62,
            high: 41.69,
            low: 39.81,
            close: 40.12,
            volume: 2632000
        }]
    },
    navigator: {
        categoryAxis: {
            labels: {
                background: "yellow"
            }
        }
    }
});
</script>

The border of the labels.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [{
            date: new Date("2016/01/01"),
            open: 41.62,
            high: 41.69,
            low: 39.81,
            close: 40.12,
            volume: 2632000
        }]
    },
    navigator: {
        categoryAxis: {
            labels: {
                border: {
                    color: "red",
                    width: 1
                }
            }
        }
    }
});
</script>

The text color of the labels. Accepts a valid CSS color string, including hex and rgb.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [{
            date: new Date("2016/01/01"),
            open: 41.62,
            high: 41.69,
            low: 39.81,
            close: 40.12,
            volume: 2632000
        }]
    },
    navigator: {
        categoryAxis: {
            labels: {
                color: "blue"
            }
        }
    }
});
</script>

The culture to use when formatting date values. See the globalization overview for more information.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [{
            date: new Date("2016/01/01"),
            open: 41.62,
            high: 41.69,
            low: 39.81,
            close: 40.12,
            volume: 2632000
        }]
    },
    navigator: {
        categoryAxis: {
            labels: {
                culture: "en-US"
            }
        }
    }
});
</script>

The format used to display the labels when the categories are dates. Uses kendo.format. Contains one placeholder ("{0}") which represents the category value.

The chart will choose the appropriate format for the current categoryAxis.baseUnit. Setting the categoryAxis.labels.format option will override the date formats.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [{
            date: new Date("2016/01/01"),
            open: 41.62,
            high: 41.69,
            low: 39.81,
            close: 40.12,
            volume: 2632000
        }]
    },
    navigator: {
        categoryAxis: {
            labels: {
                dateFormats: {
                    days: "dd/MM/yyyy",
                    months: "MMM yyyy"
                }
            }
        }
    }
});
</script>

The font style of the labels.

Default: "12px Arial,Helvetica,sans-serif"

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [{
            date: new Date("2016/01/01"),
            open: 41.62,
            high: 41.69,
            low: 39.81,
            close: 40.12,
            volume: 2632000
        }]
    },
    navigator: {
        categoryAxis: {
            labels: {
                font: "14px Arial"
            }
        }
    }
});
</script>

The format used to display the labels. Uses kendo.format. Contains one placeholder ("{0}") which represents the category value.

Default: "{0}"

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [{
            date: new Date("2016/01/01"),
            open: 41.62,
            high: 41.69,
            low: 39.81,
            close: 40.12,
            volume: 2632000
        }]
    },
    navigator: {
        categoryAxis: {
            labels: {
                format: "MMM yyyy"
            }
        }
    }
});
</script>

The margin of the labels. A numeric value will set all margins.

Default: 0

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    navigator: {
        categoryAxis: {
            labels: {
                margin: 10
            }
        }
    },
    series: [{
        type: "line",
        field: "value",
        categoryField: "date",
        data: [
            { value: 1, date: new Date(2012, 1, 1) },
            { value: 2, date: new Date(2012, 1, 2) }
        ]
    }]
});
</script>

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.

Default: false

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    navigator: {
        categoryAxis: {
            labels: {
                mirror: true
            }
        }
    },
    series: [{
        type: "line",
        field: "value",
        categoryField: "date",
        data: [
            { value: 1, date: new Date(2012, 1, 1) },
            { value: 2, date: new Date(2012, 1, 2) }
        ]
    }]
});
</script>

The padding of the labels. A numeric value will set all paddings.

Default: 0

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    navigator: {
        categoryAxis: {
            labels: {
                padding: 10
            }
        }
    },
    series: [{
        type: "line",
        field: "value",
        categoryField: "date",
        data: [
            { value: 1, date: new Date(2012, 1, 1) },
            { value: 2, date: new Date(2012, 1, 2) }
        ]
    }]
});
</script>

The rotation angle of the labels. By default the labels are not rotated.

Default: 0

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    navigator: {
        categoryAxis: {
            labels: {
                rotation: 45
            }
        }
    },
    series: [{
        type: "line",
        field: "value",
        categoryField: "date",
        data: [
            { value: 1, date: new Date(2012, 1, 1) },
            { value: 2, date: new Date(2012, 1, 2) }
        ]
    }]
});
</script>

The number of labels to skip. By default no labels are skipped.

Default: 0

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    navigator: {
        categoryAxis: {
            labels: {
                skip: 2
            }
        }
    },
    series: [{
        type: "line",
        field: "value",
        categoryField: "date",
        data: [
            { value: 1, date: new Date(2012, 1, 1) },
            { value: 2, date: new Date(2012, 1, 2) },
            { value: 3, date: new Date(2012, 1, 3) },
            { value: 4, date: new Date(2012, 1, 4) }
        ]
    }]
});
</script>

The label rendering step - render every n-th label. By default every label is rendered.

Default: 1

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    navigator: {
        categoryAxis: {
            labels: {
                step: 2
            }
        }
    },
    series: [{
        type: "line",
        field: "value",
        categoryField: "date",
        data: [
            { value: 1, date: new Date(2012, 1, 1) },
            { value: 2, date: new Date(2012, 1, 2) },
            { value: 3, date: new Date(2012, 1, 3) },
            { value: 4, date: new Date(2012, 1, 4) }
        ]
    }]
});
</script>

The template which renders the labels.

The fields which can be used in the template are:

  • value - the category value
  • dataItem - the data item for the category
  • format - the default format of the label
  • culture - the default culture (if set) on the label
  • index - the 0-based index of the current label
  • count - the total number of labels on the axis
<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    navigator: {
        categoryAxis: {
            labels: {
                template: (data) => `Label: ${data.value}`
            }
        }
    },
    series: [{
        type: "line",
        field: "value",
        categoryField: "date",
        data: [
            { value: 1, date: new Date(2012, 1, 1) },
            { value: 2, date: new Date(2012, 1, 2) }
        ]
    }]
});
</script>

If set to true the chart will display the category axis labels. By default the category axis labels are visible.

Default: true

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    navigator: {
        categoryAxis: {
            labels: {
                visible: false
            }
        }
    },
    series: [{
        type: "line",
        field: "value",
        categoryField: "date",
        data: [
            { value: 1, date: new Date(2012, 1, 1) },
            { value: 2, date: new Date(2012, 1, 2) }
        ]
    }]
});
</script>