panInteraction
Pan interaction
Description
A pan interaction allows you to pan within a chart without having to select any
buttons in the axes toolbar. To enable panning, set the Interactions
property of the axes to a panInteraction
object. When this interaction is
enabled, you can pan by dragging within the chart.
When this interaction is enabled on axes with focus, you can pan the view of the axes using the keyboard. To pan vertically, press the up arrow (↑) or down arrow (↓) key. To pan horizontally, press the left arrow (←) or right arrow (→) key. (since R2024a)
To enable multiple interactions, set the Interactions
property to an
array of objects.
Creation
Description
p = panInteraction
creates a pan interaction object.
p = panInteraction('Dimensions',d)
sets the Dimensions
property.
Use this property to constrain panning to specific dimensions. For example, p =
panInteraction('Dimensions','x')
constrains panning to the
x-dimension.
Properties
Examples
Tips
In most cases, the axes have a default set of interactions which depend on the type of chart you are displaying. You can replace the default set with a new set of interactions, but you cannot access or modify any of the interactions in the default set.