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

Implement Color-Coded Ranges in Bars

Color ranges can be used to convey additional information—for example, value composition.

This behavior is usually achieved through stacked bar series. However, if you need to convey more flexibility, consider the following Chart.

Color ranges in a Kendo UI Chart

To implement this functionality, define a series.visual that draws the ranges dynamically. Note that the visual remains in use until the next render event. This allows you to update it asynchronously or in real-time.

The following example demonstrates how to implement color-coded ranges (stripes) in bars when working with Kendo UI Charts.

    <div id="chart" />
      var WIDTH = 5;
      var draw = kendo.drawing;
      var geom = kendo.geometry;

        series: [{
          type: "bar",
          data: [10, 20, 30],
          visual: function(e) {
            var left = e.rect.topLeft();
            var right = e.rect.topRight();
            var bottom = e.rect.bottomLeft();

            var group = new draw.Group();

            for (var x = left.x; x < right.x; x += WIDTH) {
              var rect = new geom.Rect([x, left.y], [WIDTH, e.rect.height()])

              var value = Math.random();
              var path = draw.Path.fromRect(rect, {
                fill: {
                  color: value > 0.5 ? "green" : "lightgreen"
                stroke: null,

                // Custom field
                value: value


            return group;

See Also

In this article
Not finding the help you need? Improve this article