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

# GetValueByYWpf()

## Definition

Returns the series value on the chart scale determined by a WPF coordinate on the chart.

## Method Return Value

A **double** value representing a series value on the chart scale. This is normally a price value, but can represent indicator plot values as well.

## Syntax

`\<chartscale\>.GetValueByYWpf(double y)`

## Method Parameters

| Parameter | Description                                                         |
| --------- | ------------------------------------------------------------------- |
| **y**     | A **double** value representing a WPF coordinate on the chart scale |

## Examples

```csharp

protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
   // store the y location the user clicked
   double   wpfY = chartControl.MouseDownPoint.Y;

   // gets price value of the WPF coordinate passed to the method
   double   valueByYWpf = chartScale.GetValueByYWpf(wpfY);

   Print("valueByYWpf: " + valueByYWpf); //2105.49995215
}
```

In the image below, we used the Chart Control property **MouseDownPoint** as the "wpfy" variable, which in return tells us the user clicked on a Y value of 2105.499 on the chart scale.

![getvaluebyywpf](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/ninjatrader-public.docs.buildwithfern.com/19c14ca472bfa6223c6bb01f28709b19e02be203d255207962027799e9a1f7ac/docs/assets/developer/desktop-sdk/references/getvaluebyywpf-getvaluebyywpf.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=20260729T062229Z&X-Amz-Expires=604800&X-Amz-Signature=c1402b06f6b1bab27468f9b8b1f08e45878715f3d7f3baa3106749643ba71f3f&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)