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

# PresentationSource

## Definition

Provides a reference to the base window in which the chart is rendered. **PresentationSource** can be used when converting application pixels to/from device pixels via the helper methods in the [ChartingExtensions](/developer/desktop-sdk/references/common/charts/chartingextensions) class.

## Property Value

A **PresentationSource** object representing the base window in which the chart is rendered.

## Syntax

`ChartControl.PresentationSource`

## Examples

```csharp
int devicePixelX;
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
   // Obtain the device-pixel coordinate corresponding to an application-pixel X value of 500
   devicePixelX = ChartingExtensions.ConvertToHorizontalPixels(500, ChartControl.PresentationSource);
}
```