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

AxisDefaults.title

configuration

The title configuration of the axis.

The axisDefaults.title.text option must be set in order to display the title.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    title: {
      text: "Axis Title",
      color: "blue"
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

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

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    title: {
      text: "Axis Title",
      background: "lightgray"
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

The border of the title.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    title: {
      text: "Axis Title",
      border: {
        color: "red",
        width: 2
      }
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

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

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    title: {
      text: "Axis Title",
      color: "red"
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

The font style of the title.

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

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    title: {
      text: "Axis Title",
      font: "20px Arial"
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

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

Default: 5

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    title: {
      text: "Axis Title",
      margin: 20
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

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

Default: 0

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    title: {
      text: "Axis Title",
      padding: 10
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

The position of the title.

The supported values are:

  • "top" - the axis title is positioned on the top (applicable to vertical axis)
  • "bottom" - the axis title is positioned on the bottom (applicable to vertical axis)
  • "left" - the axis title is positioned on the left (applicable to horizontal axis)
  • "right" - the axis title is positioned on the right (applicable to horizontal axis)
  • "center" - the axis title is positioned in the center

Default: "center"

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    title: {
      text: "Axis Title",
      position: "top"
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

The rotation angle of the title. By default the title is not rotated.

Default: 0

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    title: {
      text: "Axis Title",
      rotation: 45
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

The text of the title.

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

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    title: {
      text: "Custom Axis Title"
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

If set to true the chart will display the axis title. By default the axis title is visible.

Default: true

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

A function that can be used to create a custom visual for the title. The available argument fields are:

  • text - the label text.
  • rect - the kendo.geometry.Rect that defines where the visual should be rendered.
  • sender - the chart instance (may be undefined).
  • options - the label options.
  • createVisual - a function that can be used to get the default visual.
<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    title: {
      text: "Axis Title",
      visual: function(e) {
        var rect = new kendo.geometry.Rect(e.rect.origin, [e.rect.size.width, e.rect.size.height]);
        var layout = new kendo.drawing.Layout(rect, {
          orientation: "vertical",
          alignContent: "center"
        });
        var text = new kendo.drawing.Text(e.text, e.rect.center(), {
          fill: {
            color: "#aa0000"
          }
        });
        layout.append(text);
        return layout;
      }
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>