# API

// Note: changes to these actions are not applied to the buttons.
const actions = [
  {
    name: 'Zoom +10%',
    handler(chart) {
      chart.zoom(1.1)
    }
  }, {
    name: 'Zoom -10%',
    handler(chart) {
      chart.zoom(2 - 1 / 0.9)
    },
  }, {
    name: 'Zoom x +10%',
    handler(chart) {
      chart.zoom({x: 1.1})
    }
  }, {
    name: 'Zoom x -10%',
    handler(chart) {
      chart.zoom({x: 2 - 1 / 0.9})
    },
  }, {
    name: 'Pan x 100px (anim)',
    handler(chart) {
      chart.pan({x: 100}, undefined, 'default')
    }
  }, {
    name: 'Pan x -100px (anim)',
    handler(chart) {
      chart.pan({x: -100}, undefined, 'default')
    },
  }, {
    name: 'Zoom x: 0..-100, y: 0..100',
    handler(chart) {
      chart.zoomScale('x', {min: -100, max: 0}, 'default')
      chart.zoomScale('y', {min: 0, max: 100}, 'default')
    }
  }, {
    name: 'Reset zoom',
    handler(chart) {
      chart.resetZoom()
    }
  }
]
Last Updated: 2/15/2025, 9:30:36 PM