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

YAxis.notes

configuration

The y axis notes configuration.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
    series: [{
        data: [1, 2, 3]
    }],
    yAxis: {
        notes: {
            position: "left",
            data: [{
                value: 2,
                label: {
                    text: "Important value"
                }
            }]
        }
    }
});
</script>

The items of the notes.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
    series: [{
        data: [1, 2, 3]
    }],
    yAxis: {
        notes: {
            data: [{
                value: 1.5,
                label: {
                    text: "Min target"
                }
            }, {
                value: 2.5,
                label: {
                    text: "Max target"
                }
            }]
        }
    }
});
</script>

The icon of the notes.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
    series: [{
        data: [1, 2, 3]
    }],
    yAxis: {
        notes: {
            data: [{
                value: 2
            }],
            icon: {
                background: "red",
                size: 16
            }
        }
    }
});
</script>

The label configuration of the notes.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
    series: [{
        data: [1, 2, 3]
    }],
    yAxis: {
        notes: {
            data: [{
                value: 2
            }],
            label: {
                background: "yellow",
                color: "black",
                font: "12px Arial"
            }
        }
    }
});
</script>

The line of the notes.

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

The position of the y axis notes.

  • "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]]
    }],
    yAxis: {
      notes: {
        data: [{ value: 1.3 }],
        position: "left"
      }
    }
  });
</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.
  • value - the note value.
<div id="chart"></div>
<script>
  $("#chart").kendoChart({
    series: [{
      type: "scatter",
      data: [[1, 2], [2, 3]]
    }],
    yAxis: {
      notes: {
        data: [{
          value: 1.3,
          visual: function (e) {
            var targetPoint = { x: e.rect.origin.x, y: e.rect.center().y };
            var line = new kendo.drawing.Path()
            .moveTo(targetPoint.x, targetPoint.y)
            .lineTo(targetPoint.x + 10, targetPoint.y);
            var circle = new kendo.drawing.Circle(new kendo.geometry.Circle([targetPoint.x + 30, targetPoint.y], 20), {
              fill: {
                color: "red"
              }
            });

            return new kendo.drawing.Group().append(line, circle);
          }
        }]
      }
    }
  });
</script>