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

Maintain the Pan and Zoom State of the Chart on Rebind


Product Progress® Kendo UI® Chart for jQuery
Operating System Windows 10 64bit
Visual Studio Version Visual Studio 2017
Preferred Language JavaScript


How can I store and load the axis range on pan-and-zoom in the Chart?


Normally, the Kendo UI Chart resets the axis range after the data source fetches new data. If users pan or zoom the Chart, they will see the initial viewport after the new data is loaded.

The following example demonstrates how to store and load the axis range. Changes are detected in the drag and zoom events. The axis range is restored in the databound event.

    <button id="rebind">Rebind Chart</button>
    <div id="chart"></div>
      // Sample data
      var data = [];
      for (var i = 0; i < 100; i++) {
        var val = Math.round(Math.random() * 10);
          category: "C" + i,
          value: val

      function createChart() {
        var axisMin = 0;
        var axisMax = 10;

        function updateRange(e) {
          var axis = e.sender.getAxis('axis')
          var range = axis.range()
          axisMin = range.min;
          axisMax = range.max;

        function restoreRange(e) {
          e.sender.options.categoryAxis.min = axisMin;
          e.sender.options.categoryAxis.max = axisMax;

          renderAs: "canvas",
          dataSource: {
            data: data
          categoryAxis: {
            name: "axis",
            min: axisMin,
            max: axisMax,
            labels: {
              rotation: "auto"
          series: [{
            type: "column",
            field: "value",
            categoryField: "category"
          pannable: {
            lock: "y"
          zoomable: {
            mousewheel: {
              lock: "y"
            selection: {
              lock: "y"
          zoom: updateRange,
          drag: updateRange,
          dataBound: restoreRange

      $("#rebind").click(function() {


See Also

In this article