> 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.

# BarWidthArray

## Definition

An array containing the values of the [BarWidth](/developer/desktop-sdk/references/chart-style/barwidth) properties of all Bars objects applied to the chart.

## Property Value

An array of double variables containing the values of the BarWidth properties of Bars objects on the chart.

## Syntax

`ChartControl.BarWidthArray[]`

## Examples

```csharp
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
   // Assign BarWidthArray to a new array
   double[] barWidths = chartControl.BarWidthArray;
 
   double referenceWidth = barWidths[0];
 
   // Trigger an alert if bar widths on the chart differ
   foreach (double width in barWidths)
   {
       if (width != referenceWidth)
           Alert("mismatchWidths", Priority.Low, "Bar widths on the chart do not match!", " ", 20, Brushes.White, Brushes.Black);
   }
}
```