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

# BarMarginLeft

## Definition

A hard-coded minimum bar margin value, set to 8 pixels, which can be used as a base value when creating custom Chart Styles.

## Property Value

A value representing the minimum margin applied to the left edge of bars. This value is hard-coded to 8 pixels, and it can be used as a base value when setting the bar margin in custom [Chart Styles](/developer/desktop-sdk/references/chart-style).

## Syntax

`ChartControl.BarMarginLeft`

## Example

```csharp
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
     // Print the number of pixels maintained as a margin to the left of bars
     double barMargin = chartControl.BarMarginLeft;
     Print(barMargin);
}
```

Based on the image below, BarMarginLeft reveals that the minimum margin maintained to the left of each bar is 8 pixels on this chart.

![ChartControl\_BarMarginLeft](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/ninjatrader-public.docs.buildwithfern.com/bd97ec792e40d1cb2371c25ae94cd3141752afec366e96db2bbcac0aa1e16c1f/docs/assets/developer/desktop-sdk/references/barmarginleft-chartcontrol-barmarginleft.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=20260729T062331Z&X-Amz-Expires=604800&X-Amz-Signature=8fe045c7bd64e92a81b42c470f7d3b1a8dce6e96ca8ce999ccd3b51d3fd20904&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)