Edit this page

seriesDefaults.visual Function

A function that can be used to create a custom visual for the points. Applicable for bar and column series. The available argument fields are:

  • rect - the kendo.geometry.Rect that defines where the visual should be rendered.
  • options - the point options.
  • createVisual - a function that can be used to get the default visual.
  • category - the point category.
  • dataItem - the point dataItem.
  • value - the point value.
  • sender - the chart instance.
  • series - the point series.

Example - using custom visual

<div id="chart"></div>
<script>
  $("#chart").kendoChart({
    seriesDefaults: {
      visual: function (e) {
        var origin = e.rect.origin;
        var center = e.rect.center();
        var bottomRight = e.rect.bottomRight();

        var path = new kendo.drawing.Path({
          fill: {
            color: e.options.color
          }
        })
        .moveTo(origin.x, bottomRight.y)
        .lineTo(bottomRight.x, bottomRight.y)
        .lineTo(center.x, origin.y)
        .close();

        return path;
      }
    },
    series: [{
      data: [1, 2, 3]
    }]
  });
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy