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

XAxis.notes

configuration

The x axis notes configuration.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  xAxis: {
    notes: {
      position: "top",
      data: [{
        value: 2,
        text: "Note at 2"
      }]
    }
  },
  series: [
    { type: "scatter", data: [[1, 2], [2, 3], [3, 4]] }
  ]
});
</script>

The items of the notes.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  xAxis: {
    notes: {
      data: [
        { value: 1, label: { text: "First" } },
        { value: 3, label: { text: "Third" } }
      ]
    }
  },
  series: [
    { type: "line", data: [1, 2, 3, 4] }
  ]
});
</script>

The icon of the notes.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  xAxis: {
    notes: {
      icon: {
        background: "blue",
        size: 20,
        type: "square"
      },
      data: [{
        value: 2,
        text: "Custom icon"
      }]
    }
  },
  series: [
    { type: "scatter", data: [[1, 2], [2, 3], [3, 4]] }
  ]
});
</script>

The label of the notes.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  xAxis: {
    notes: {
      label: {
        background: "lightgreen",
        color: "black",
        font: "bold 12px Arial"
      },
      data: [{
        value: 2,
        text: "Styled label"
      }]
    }
  },
  series: [
    { type: "scatter", data: [[1, 2], [2, 3], [3, 4]] }
  ]
});
</script>

The line of the notes.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  xAxis: {
    notes: {
      line: {
        color: "red",
        width: 3,
        dashType: "dash"
      },
      data: [{
        value: 2,
        text: "Custom line"
      }]
    }
  },
  series: [
    { type: "scatter", data: [[1, 2], [2, 3], [3, 4]] }
  ]
});
</script>

The position of the x axis note.

  • "top" - The note is positioned on the top.
  • "bottom" - The note is positioned on the bottom.
  • "left" - The note is positioned on the left.
  • "right" - The note is positioned on the right.
<div id="chart"></div>
<script>
  $("#chart").kendoChart({
    series: [{
      type: "scatter",
      data: [[1, 2], [2, 3]]
    }],
    xAxis: {
      notes: {
        position: "bottom",
        data: [{ value: 1.3 }]
      }
    }
  });
</script>

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

  • rect - the kendo.geometry.Rect that defines the note target rect.
  • sender - the chart instance (may be undefined).
  • options - the note options.
  • createVisual - a function that can be used to get the default visual.
  • value - the note value.
<div id="chart"></div>
<script>
  $("#chart").kendoChart({
    series: [{
      type: "scatter",
      data: [[1, 2], [2, 3]]
    }],
    xAxis: {
      notes: {
        data: [{
          value: 1.3
        }],
        visual: function (e) {
          var targetPoint = { x: e.rect.center().x, y: e.rect.origin.y };
          var line = new kendo.drawing.Path()
          .moveTo(targetPoint.x, targetPoint.y)
          .lineTo(targetPoint.x, targetPoint.y - 10);
          var circle = new kendo.drawing.Circle(new kendo.geometry.Circle([targetPoint.x, targetPoint.y - 30], 20), {
            fill: {
              color: "red"
            }
          });

          return new kendo.drawing.Group({
            zIndex: 1
          }).append(line, circle);
        }
      }
    }
  });
</script>