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

# BarWidth

## Definition

Measures the value of the **bar width** set for the primary Bars object on the chart.

This property value is not stated in pixels. To obtain the pixel-width of bars on the chart, use **GetBarPaintWidth()** instead.

## Property Value

A **double** representing the value of the bar width.

## Syntax

`\<chartcontrol\>.BarWidth`

## Examples

```csharp
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
    double barWidth = chartControl.BarWidth;

    // Prints the width of bars on the chart
    Print(barWidth);
}
```

Based on the image below, BarWidth reveals that the bars on the chart are 4.02 pixels wide.

![ChartControl\_BarWidth](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/ninjatrader-public.docs.buildwithfern.com/36c1997cc2f97bccab3f3dd4171d91c3e371f3ac073878398ee8fb821b9f2008/docs/assets/developer/desktop-sdk/references/chartcontrol-barwidth-chartcontrol-barwidth.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260729%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260729T070257Z&X-Amz-Expires=604800&X-Amz-Signature=05cf2cbff8e97a42d663b606977dd6994c4d36b737570657571bded5c1010e90&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)