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

Series.notes

configuration

The series notes configuration.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  dataSource: {
    data: [
      { value: 1, noteText: "Min value" },
      { value: 2, noteText: "" },
      { value: 3, noteText: "Max value" }
    ]
  },
  series: [{
    field: "value",
    noteTextField: "noteText",
    notes: {
      position: "top",
      icon: {
        background: "red"
      },
      label: {
        font: "12px Arial"
      }
    }
  }]
});
</script>

The icon of the notes.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  dataSource: {
    data: [
      { value: 1, noteText: "First" },
      { value: 2, noteText: "" },
      { value: 3, noteText: "Last" }
    ]
  },
  series: [{
    field: "value",
    noteTextField: "noteText",
    notes: {
      icon: {
        background: "blue",
        size: 20,
        type: "square",
        border: {
          color: "red",
          width: 2
        }
      }
    }
  }]
});
</script>

The label of the notes.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  dataSource: {
    data: [
      { value: 1, noteText: "Low" },
      { value: 2, noteText: "" },
      { value: 3, noteText: "High" }
    ]
  },
  series: [{
    field: "value",
    noteTextField: "noteText",
    notes: {
      label: {
        background: "yellow",
        font: "14px Arial",
        color: "blue",
        border: {
          color: "red",
          width: 1
        }
      }
    }
  }]
});
</script>

The line of the notes.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  series: [{
    notes: {
      data: [{
        value: 15
      }],
      line: {
        width: 3,
        color: "red"
      }
    },
    data: [10, 15, 20]
  }]
});
</script>

The position of the series 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({
  dataSource: {
    data: [
      { value: 1, noteText: "Important" },
      { value: 2, noteText: "" },
      { value: 3, noteText: "Critical" }
    ]
  },
  series: [{
    field: "value",
    noteTextField: "noteText",
    notes: {
      position: "bottom"
    }
  }]
});
</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.
  • options - the note options.
  • createVisual - a function that can be used to get the default visual.
  • category - the category of the note point.
  • dataItem - the dataItem of the note point.
  • value - the value of the note point.
  • sender - the chart instance.
  • series - the series of the note point.
  • text - the note text.
<div id="chart"></div>
<script>
  $("#chart").kendoChart({
    dataSource: {
      data: [{
        value: 1,
        noteText: "A"
      }]
    },
    series: [{
      field: "value",
      noteTextField: "noteText",
      notes: {
        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"
            }
          });

          var text = new kendo.drawing.Text(e.text);
          var bbox = text.bbox();
          text.position([targetPoint.x - 20 + (40 - bbox.width()) / 2, targetPoint.y - 50 + (40 - bbox.height()) / 2]);
          return new kendo.drawing.Group().append(line, circle, text);
        }
      }
    }]
  });
</script>