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

# LastTimePainted

## Definition

Indicates the time of the most recently painted bar on the primary **Bars** object configured on the chart.

## Property Value

A **DateTime** object corresponding to the slot index of the most recently painted bar.

## Syntax

`\<chartcontrol\>.LastTimePainted`

## Examples

```csharp
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
   DateTime lastSlotTime = chartControl.LastTimePainted;

   // Print the index of the last slot painted on the chart
   Print(lastSlotTime);
}
```

In the image below, LastTimePainted reveals that the last index painted on the chart corresponds to 8/12/17 at 2:10:00 PM.

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