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

# PanelIndex

## Definition

Indicates the index of the chart panel in the collection of configured panels.

This property comes from a zero-based index, which is not the same as the panel number displayed in the Indicators window opened from within the chart. The panel number displayed in the Indicators window will equate to **ChartPanel.PanelIndex** + 1.

## Property Value

A **int** representing the zero-based index of the panel.

## Syntax

`ChartPanel.PanelIndex`

## Examples

```csharp
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
    base.OnRender(chartControl, chartScale);

    // Print the panel's zero-based index
    Print(String.Format("This panel sits at index {0}", ChartPanel.PanelIndex));
}
```

Notice three things in the image below:

* An indicator containing the example code above is configured on the second chart panel.
* In the Indicators window, the "Panel" property is set to 2.
* The output of the example code displays the zero-based index of Panel #2, which is at index 1.

![ChartPanel\_PanelIndex](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/ninjatrader-public.docs.buildwithfern.com/fb46eb5da10501d6e6c79470ccc7d784c2ae6365fe926ff3698c9090ceed6377/docs/assets/developer/desktop-sdk/references/panelindex-chartpanel-chartpanel-panelindex.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=20260729T070926Z&X-Amz-Expires=604800&X-Amz-Signature=c69c88c78d2472eed30761fbdd04932eec6244892e64f9c5576af38f01f64062&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)