New to Kendo UI for jQueryStart a free 30-day trial

ValueAxis.labels

configuration

The axis labels configuration.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: [{
    labels: {
      background: "green",
      color: "white"
    }
  }],
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

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

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: {
    labels: {
      background: "#aa00bb"
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>
<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: {
    labels: {
      background: "rgb(128, 0, 255)"
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>
<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: {
    labels: {
      background: "green"
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

The border of the labels.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: [{
    labels: {
      border: {
        color: "green",
        dashType: "dashDot",
        width: 1
      }
    }
  }],
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

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

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: {
    labels: {
      color: "#aa00bb"
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>
<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: {
    labels: {
      color: "rgb(128, 0, 255)"
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>
<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: {
    labels: {
      color: "green"
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

The font style of the labels. Accepts a valid CSS color string, for example "20px 'Courier New'".

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

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: [{
    labels: {
       font: "20px sans-serif",
    }
  }],
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

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

Default: "{0}"

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: [{
    labels: {
       format: "{0:C}"
    }
  }],
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

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

Default: 0

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: [{
    labels: {
      margin: 20
    }
  }],
  series: [
    { data: [1, 2, 3] }
  ]
});
</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.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: [{
    labels: {
      mirror: true
    },
    categories: ["2012", "2013"]
  }],
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

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

Default: 0

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: [{
    labels: {
      padding: 20
    }
  }],
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

The position of the axis labels. By default, labels are positioned next to the axis.

  • When position is set to end, 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 to start, 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.

Default: "onAxis"

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: [{
    labels: {
      position: 'end'
    }
  }],
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>
Number|String|Object

The rotation angle (in degrees) of the labels. By default the labels are not rotated. Angles increase clockwise and zero is to the left. Negative values are acceptable. Can be set to "auto" if the axis is horizontal in which case the labels will be rotated only if the slot size is not sufficient for the entire labels.

Default: 0

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: [{
    labels: {
      rotation: 90
    }
  }],
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

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

Default: 0

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: [{
    labels: {
      skip: 1
    }
  }],
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

Label rendering step. Every n-th label is rendered where n is the step

Default: 1

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: [{
    labels: {
      step: 2
    }
  }],
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

The template which renders the labels.

The fields which can be used in the template are:

  • value - the value value

The text can be split into multiple lines by using line feed characters ("\n").

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: [{
    labels: {
      template: "Year: #: value #"
    }
  }],
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>
<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: [{
    labels: {
      template: kendo.template("Year: #: value #")
    }
  }],
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

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

Default: true

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  valueAxis: [{
    labels: {
      visible: false
    }
  }],
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

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
<div id="chart"></div>
<script>
  $("#chart").kendoChart({
    valueAxis: [{
      labels: {
        visual: function(e) {
          var center = e.rect.center();
          return new kendo.drawing.Text(e.text, e.rect.origin, {
            fill: {
              color: "red"
            }
          });
        }
      }
    }],
    series: [
      { data: [1, 2, 3] }
    ]
  });
</script>