Edit this page

Use Fixed Bar Size

You might need to set the size of the default drawing element of the bars to the same size.

The example below demonstrates how to use the series.visual function to scale the default drawing element of the bars and achieve this behavior.

Example
    <div id="chart"></div>
    <script>
      var BAR_SIZE = 10;
      $("#chart").kendoChart({
        series: [{
          type: "bar",
          data: [1, 2],
          visual: function(e) {
            //create the default visual
            var visual = e.createVisual();        
            //scale it so that it has the predefined size
            visual.transform(kendo.geometry.transform().scale(1, BAR_SIZE / e.rect.size.height, e.rect.center() ));
            return visual;
          }
        }]            
      });
    </script>
    </div>

See Also

For more runnable examples on Kendo UI Charts, browse the How To documentation folder.

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy