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

# GetAttachedToChartBars()

## Definition

Returns information which relate to the underlying bars series in which the drawing tool is attached. If the drawing tool is attached to an indicator rather than a bar series, the indicator's bars series used for input will be returned.

For drawing tools made global, this method will not be returning meaningful values - since those are not attached to a specific bars series.

## Method Return Value

A **ChartBars** object

## Syntax

`GetAttachedToChartBars()`

## Method Parameters

This method does not accept any parameters.

## Examples

```csharp
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{   
   // get the attached chart bars
   ChartBars myBars = GetAttachedToChartBars();
   
   Print(myBars.Bars.ToChartString()); // NQ 03-15 (1 Minute)
}
```