WindowBarsPerChart

Description

The WindowBarsPerChart method returns the number of bars visible in the current chart window.

Syntax

public WindowBarsPerChart(): number

Return Value

Returns a number representing the count of visible bars in the chart window.

Example

try {
  const visibleBars = this.api.WindowBarsPerChart();
  console.log(`Number of visible bars: ${visibleBars}`);
} catch (error) {
  console.error("Failed to get visible bars count:", error.message);
}

Last updated