Skip to content

Pane Object

Pane Object describes a chart pane. Pane id is determined by its position in the panes array:

js
// Dataset root object
{
    panes: [
        {…}, // Pane #0
        {…}, // Pane #1
        {…}, // Pane #2
        // ...
    ]
}

INFO

means that it's expected that the library can change the property. But this only applies to the Low-Level API and not Data API, which is specifically designed to manipulate the dataset.

pane.id

  • Type: number

A sequential id, heavily used in the library, calculated by DataHub. Usually you need to specify it to access stuff.

pane.uuid

  • Type: string

A Unique id that stays the same even if the pane changes its position. Generated by DataHub.

pane.overlays

Array of overlays displayed on this pane. See Overlay Object for more details.

pane.scripts

Array of scripts executed on this pane. See Script Object and Scripts Intro for more details.

pane.settings

  • Type: Object

Pane settings. Specifies how the overlays on this pane should be rendered.

pane.settings.scales

  • Type: Object

Associative array of scale definitions:

js
// Example of pane.settings.scales
{
    A: {
        precision: 2
    },
    B: {
        // ...
    },
    // ...
}

scale.precision

  • Type: number

Precision of this scale - number of digits after the point. Overwrites all precisions on the overlay level.

pane.settings.scaleTemplate

  • Type: Array
  • Default: [[], ['A', …]] Places all scales on the right side

The template tells how to place scales, requested by overlays.

js
// All scales on the right side
{
    scaleTemplate: [[], ['A', 'B']]
}

// All scales on the left side
{
    scaleTemplate: [['A', 'B'], []]
}

// Scales on both sides
{
    scaleTemplate: [['A'], ['B']]
}

// The same scale on the left and on the right side
{
    scaleTemplate: [['A'], ['A']]
}

// No scales at all (hide them)
{
    scaleTemplate: [[], []]
}

pane.settings.scaleIndex

  • Type: string
  • Default: A

Main scale index, used for building the grid (the actual # grid). You can set it manually here, or use the library UI to switch between different scales.

pane.settings.scaleSideIdxs

  • Type: Array
  • Default: ['<First Left Scale>', '<First Right Scale>']

Sets which scales will be visible on both sidebars. It defaults to the first scale on each side of scaleTemplate. If a template side is empty, sets it to undefined.

pane.settings.height

  • Type: number

A weight that used to calculate in what proportion the y-space is divided between all panes. Let's look at an example:

js
pane1.settings.height = 3  
pane2.settings.height = 2
pane3.settings.height = 1

// Pane1 will take 3 / (3 + 2 + 1) = 1/2 = 50% of the space
// Pane2 will take 2 / (3 + 2 + 1) = 1/3 = 33% of the space
// Pane3 will take 1 / (3 + 2 + 1) = 1/6 = 17% of the space

You can also take a height of the "grid zone": chart.height - layout.botbar.height as the total space and specify the heights of all panes in pixels.

Released under the MIT License.