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

# OnMouseUp()

## Definition

An event driven method is called any time the mouse pointer is over the chart control and a mouse button is being released.

## Method Return Value

This method does not return a value.

For a combined single click operation, i.e. mouse down click, move and release the dataPoint reported will always be the initial starting one.

## Syntax

You must override the method with the following syntax.

`public override void OnMouseUp(ChartControl chartControl, ChartPanel chartPanel, ChartScale chartScale, ChartAnchor dataPoint)`

## Method Parameters

| Parameter        | Description                                                                                                                             |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **chartControl** | A [ChartControl](/developer/desktop-sdk/references/common/charts/chartcontrol) representing the x-axis                                  |
| **chartPanel**   | A [ChartPanel](/developer/desktop-sdk/references/common/charts/chartpanel) representing the the panel for the chart                     |
| **chartScale**   | A [ChartScale](/developer/desktop-sdk/references/common/charts/chartscale) representing the y-axis                                      |
| **dataPoint**    | A [ChartAnchor](/developer/desktop-sdk/references/drawing-tools/chartanchor) representing a point where the user is releasing the mouse |

## Examples

```csharp
public override void OnMouseUp(ChartControl chartControl, ChartPanel chartPanel, ChartScale chartScale, ChartAnchor dataPoint)
{
   //when the user releases the mouse, ensure the drawing state is set to normal
   if (DrawingState == DrawingState.Editing || DrawingState == DrawingState.Moving)
     DrawingState = DrawingState.Normal;
}
```