> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# BarsArray

## Definition

Provides a collection of **ChartBars** objects currently configured on the chart.

## Property Value

An **ObservableCollection** of **ChartBars** objects.

## Syntax

`\<chartcontrol\>.BarsArray`

## Examples

```csharp
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
   // Instantiate a new <chartcontrol`>.BarsArray collection
   System.Collections.ObjectModel.ObservableCollection<chartbars> myChartBars = chartControl.BarsArray;
 
   // Print the number of bars in each Bars object within the <chartcontrol`>.BarsArray collection
   foreach(ChartBars bars in myChartBars)
   {
       Print(bars.Bars.Count);
   }
}
```