Skip to content

PinPlot action

Use this action with change({ id: 'PinPlot', 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
  • targetAxis (for Update): PrimaryAxis | SecondaryAxis | NoAxis

Behavior

PinPlot moves a plot between axes in its pane.

It is conceptually the axis version of MovePlot:

  • Get: returns which axis targets are currently valid
  • Update: moves the plot to one selected target

Sub-actions

Get

Returns the list of valid axis targets for the selected plot.

  • Returns [] if selector/type does not resolve to a matching plot.
  • PrimaryAxis: primary axis for that pane.
  • SecondaryAxis: the other axis in that pane.
  • NoAxis: detached axis mode for that plot.
  • NoAxis is available only when at least one other plot in the pane remains axis-attached.

Example:

const targets = chart.change({
id: "PinPlot",
context: { id: "Get", type: "Study", uid: studyUid },
});

Update

Pins the selected plot to targetAxis.

  • If targetAxis is not valid for the current plot (or missing), nothing changes.
  • NoAxis uses detached-scale behavior for the plot.

Example:

chart.change({
id: "PinPlot",
context: { type: "Study", uid: studyUid, targetAxis: "SecondaryAxis" },
});