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

# OnRender()

## Definition

An event driven method used to render content to a ChartStyle. The **OnRender()** method is called every time the chart values are updated. These updates are driven by incoming data to the chart bars or by a user manually interacting with the chart control or chart scale.

## Method Return Value

This method does not return a value.

## Syntax

You must override the method in your ChartStyle with the following syntax:

`protected override void OnRender(ChartControl chartControl, ChartScale chartScale, ChartBars chartBars)  \{  \}`

## Method Parameters

| Parameter        | Description                                            |
| ---------------- | ------------------------------------------------------ |
| **chartControl** | A ChartControl representing the x-axis                 |
| **chartScale**   | A ChartScale representing the y-axis                   |
| **chartBars**    | A ChartBars representing the Bars series for the chart |

## Examples

```csharp
protected override void OnRender(ChartControl chartControl, ChartScale chartScale, ChartBars chartBars)
{
    // Rendering logic for our chart style
}
```