Skip to content

MovePlot action

Use this action with change({ id: 'MovePlot', context }).

Context

  • id?: Get | Update (Update is assumed if omitted)
  • type: plot type (Symbol | Study | IncomeStatement | BalanceSheet | Expression | Forward | Seasonal)
  • plot selector: uid (preferred) or index
  • targetPane (for Update): ExistingAbove | NewAbove | ExistingBelow | NewBelow

Behavior

MovePlot moves a plot between panes.

MovePlot has two sub-actions:

  • Get: returns which move targets are currently valid
  • Update: performs the move to a chosen target

Sub-actions

Get

Returns the list of valid targets for the selected plot.

  • Returns [] if selector/type does not resolve to a matching plot.
  • ExistingAbove / ExistingBelow are available when there is already a pane above/below.
  • NewAbove / NewBelow are available when a new pane can be created above/below the current pane.

Example:

const targets = chart.change({
id: "MovePlot",
context: { id: "Get", type: "Seasonal", uid: seasonalUid },
});

Update

Moves the selected plot to targetPane.

  • If targetPane is not valid for the current plot (or missing), nothing changes.
  • If NewAbove/NewBelow is used, the chart creates a new pane on that side and moves the plot there.

Example:

chart.change({
id: "MovePlot",
context: { type: "Seasonal", uid: seasonalUid, targetPane: "NewBelow" },
});