# Class: crossline

## [CIQ](CIQ.html)[.Drawing](CIQ.Drawing.html). crossline ()

Crossline drawing tool.

#### new crossline()

Version:  
- ChartIQ Advanced Package

### Extends

- [CIQ.Drawing.vertical](CIQ.Drawing.vertical.html)

### Members

#### chartsOnly :boolean

Set this parameter to `true` to restrict drawing from being rendered on
a study panel.

This parameter may be set for all drawings, for a specific drawing type,
or for a specific drawing instance. See examples.

##### Type:

- boolean

Inherited From:  
- [CIQ.Drawing#chartsOnly](CIQ.Drawing.html#chartsOnly)

Overrides:  
- [CIQ.Drawing.vertical#chartsOnly](CIQ.Drawing.vertical.html#chartsOnly)

##### Example

``` javascript
// Set drawing instance to chartsOnly. Only this one drawing will be affected.
drawing.chartsOnly=true;
// Set a particular drawing prototype to chartsOnly. All drawings to type "difference" will be affected.
CIQ.Drawing["difference"].prototype.chartsOnly=true;
// Set all drawings to chartsOnly.
CIQ.Drawing.prototype.chartsOnly=true;
```

#### configs :Array.\<string\>

List of drawing settings to enable for this drawing. Some of the more
common settings are: "color", "fillColor", "lineWidth", "pattern"; but
for more complex drawings there are additional ones.

By resetting this array, you can control which settings are available
for drawings of this type as well as any drawings that share the
prototype with this drawing.

##### Type:

- Array.\<string\>

Since:  
- 9.7.0

Inherited From:  
- [CIQ.Drawing.BaseTwoPoint#configs](CIQ.Drawing.BaseTwoPoint.html#configs)

Overrides:  
- [CIQ.Drawing.vertical#configs](CIQ.Drawing.vertical.html#configs)

#### dragToDraw :boolean

Used to set the user behavior for creating drawings.

By default, a drawing is created with this
sequence:`move crosshair to staring point` → `click` →
`move crosshair to ending point` → `click`.

> On a touch device this would be:`move crosshair to staring point` →
> `tap` → `move crosshair to ending point` → `tap`.

Set dragToDraw to `true` to create the drawing with the following
alternate sequence:`move crosshair to staring point` → `mousedown` →
`drag` → `mouseup`

> On a touch device this would be:`move crosshair to staring point` →
> `press` → `drag` → `release`.

This parameter is **not compatible** with drawings requiring more than
one drag movement to complete, such as:

- Channel
- Continuous Line
- Elliott Wave
- Gartley
- Pitchfork
- Fibonacci Projection

Line and Ray have their own separate parameter, which also needs to be
set in the same way, if this option is desired:
`CIQ.Drawing.line.prototype.dragToDraw=true;`

This parameter may be set for all drawings compatible with it, for a
specific drawing type, or for a specific drawing instance. See examples.

##### Type:

- boolean

Inherited From:  
- [CIQ.Drawing#dragToDraw](CIQ.Drawing.html#dragToDraw)

Overrides:  
- [CIQ.Drawing.vertical#dragToDraw](CIQ.Drawing.vertical.html#dragToDraw)

##### Example

``` javascript
// set drawing instance to dragToDraw. Only this one drawing will be affected
drawing.dragToDraw=true;
// Set particular drawing prototype to dragToDraw. All drawings to type "difference" will be affected
CIQ.Drawing["difference"].prototype.dragToDraw=true;
// Set all drawings to dragToDraw
CIQ.Drawing.prototype.dragToDraw=true;
```

#### permanent :boolean

Set this to true to disable selection, repositioning, and deletion by
the end user.

This parameter may be set for all drawings, for a specific drawing type,
or for a specific drawing instance. See examples.

##### Type:

- boolean

Inherited From:  
- [CIQ.Drawing#permanent](CIQ.Drawing.html#permanent)

Overrides:  
- [CIQ.Drawing.vertical#permanent](CIQ.Drawing.vertical.html#permanent)

##### Example

``` javascript
// set drawing instance to permanent. Only this one drawing will be affected
drawing.permanent=true;
// Set particular drawing prototype to permanent. All drawings to type "difference" will be affected
CIQ.Drawing["difference"].prototype.permanent=true;
// Set all drawings to permanent
CIQ.Drawing.prototype.permanent=true;
```

### Methods

#### abort(forceClear)

This function is called to tell a drawing to abort itself. It should
clean up any rendered objects such as DOM elements or toggle states. It
does not need to clean up anything that it drew on the canvas.

##### Parameters:

| Name         | Type    | Description                                                              |
|--------------|---------|--------------------------------------------------------------------------|
| `forceClear` | boolean | Indicates that the user explicitly deleted the drawing (advanced usage). |

Inherited From:  
- [CIQ.Drawing#abort](CIQ.Drawing.html#abort)

Overrides:  
- [CIQ.Drawing.vertical#abort](CIQ.Drawing.vertical.html#abort)

#### adjust()

Called whenever periodicity changes so that drawings can adjust their
rendering.

Inherited From:  
- [CIQ.Drawing#adjust](CIQ.Drawing.html#adjust)

Overrides:  
- [CIQ.Drawing.vertical#adjust](CIQ.Drawing.vertical.html#adjust)

#### boxToPixels(stx, panelName, box \[, yAxis\])

Converts a box represented by two corner coordinates \[tick0,value0\]
and \[tick1,value1\] into pixel coordinates. This is important for
drawing tools or any other device that requires the actual underlying
price. This function is preferred over
[CIQ.convertBoxToPixels](CIQ.html#.convertBoxToPixels) when used by
drawing functions because it automatically returns the pixel values
based off the values of the box as if they were values of the plot
corresponding to the drawing's `field` property.
[CIQ.convertBoxToPixels](CIQ.html#.convertBoxToPixels) usually returns
the pixel values of the box assuming those values are the main series
plot's values.

##### Parameters:

<table class="params table table-striped">
<colgroup>
<col style="width: 25%" />
<col style="width: 25%" />
<col style="width: 25%" />
<col style="width: 25%" />
</colgroup>
<thead>
<tr class="header">
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td class="name"><code>stx</code></td>
<td class="type"><a href="CIQ.ChartEngine.html">CIQ.ChartEngine</a></td>
<td class="attributes"></td>
<td class="description last"><p>The chartEngine</p></td>
</tr>
<tr class="even">
<td class="name"><code>panelName</code></td>
<td class="type">string</td>
<td class="attributes"></td>
<td class="description last"><p>Panel on which the coordinates
reside</p></td>
</tr>
<tr class="odd">
<td class="name"><code>box</code></td>
<td class="type">object</td>
<td class="attributes"></td>
<td class="description last"><p>Box to convert</p>
<h6>Properties</h6>
<table class="params table table-striped">
<colgroup>
<col style="width: 25%" />
<col style="width: 25%" />
<col style="width: 25%" />
<col style="width: 25%" />
</colgroup>
<thead>
<tr class="header">
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td class="name"><code>x0</code></td>
<td class="type">number</td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"></td>
</tr>
<tr class="even">
<td class="name"><code>y0</code></td>
<td class="type">number</td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"></td>
</tr>
<tr class="odd">
<td class="name"><code>x1</code></td>
<td class="type">number</td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"></td>
</tr>
<tr class="even">
<td class="name"><code>y1</code></td>
<td class="type">number</td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"></td>
</tr>
</tbody>
</table></td>
</tr>
<tr class="even">
<td class="name"><code>yAxis</code></td>
<td class="type"><a
href="CIQ.ChartEngine.YAxis.html">CIQ.ChartEngine.YAxis</a></td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"></td>
</tr>
</tbody>
</table>

Since:  
- 8.4.0

Inherited From:  
- [CIQ.Drawing#boxToPixels](CIQ.Drawing.html#boxToPixels)

Overrides:  
- [CIQ.Drawing.vertical#boxToPixels](CIQ.Drawing.vertical.html#boxToPixels)

##### Returns:

A converted box

Type  
object

#### click(context, tick, value)

Called when a user clicks while drawing.

##### Parameters:

| Name      | Type   | Description                     |
|-----------|--------|---------------------------------|
| `context` | object | The canvas context.             |
| `tick`    | number | The tick in the `dataSet`.      |
| `value`   | number | The value (price) of the click. |

Inherited From:  
- [CIQ.Drawing#click](CIQ.Drawing.html#click)

Overrides:  
- [CIQ.Drawing.vertical#click](CIQ.Drawing.vertical.html#click)

##### Returns:

True if the drawing is complete. Otherwise the kernel continues
accepting clicks.

Type  
boolean

#### construct(stx, panel)

Initializes the drawing

##### Parameters:

| Name    | Type                                                | Description          |
|---------|-----------------------------------------------------|----------------------|
| `stx`   | [CIQ.ChartEngine](CIQ.ChartEngine.html)             | The chart object.    |
| `panel` | [CIQ.ChartEngine.Panel](CIQ.ChartEngine.Panel.html) | The panel reference. |

Inherited From:  
- [CIQ.Drawing#construct](CIQ.Drawing.html#construct)

Overrides:  
- [CIQ.Drawing.vertical#construct](CIQ.Drawing.vertical.html#construct)

#### copyConfig(withPreferences)

Instance function used to copy the relevant drawing parameters into
itself. It just calls the static function.

##### Parameters:

| Name              | Type    | Description                                        |
|-------------------|---------|----------------------------------------------------|
| `withPreferences` | boolean | set to true to return previously saved preferences |

Since:  
- 3.0.0

Inherited From:  
- [CIQ.Drawing#copyConfig](CIQ.Drawing.html#copyConfig)

Overrides:  
- [CIQ.Drawing.vertical#copyConfig](CIQ.Drawing.vertical.html#copyConfig)

#### getLineColor(color \[, ignoreHighlight\])

Compute the proper color to use when rendering lines in the drawing.

Will use the color but if set to auto or transparent, will use the
container's defaultColor. However, if color is set to auto and the
drawing is based off a series or study plot, this function will return
that plot's color. If drawing is highlighted will use the highlight
color as defined in stx_highlight_vector style.

##### Parameters:

| Name              | Type    | Argument     | Description                                                                                                        |
|-------------------|---------|--------------|--------------------------------------------------------------------------------------------------------------------|
| `color`           | string  |              | Color string to check and use as a basis for setting. If not supplied, uses this.color.                            |
| `ignoreHighlight` | boolean | \<optional\> | True to ignore highlighting status when determining color (for example, if a label, or if determining fill color). |

Since:  
- 7.0.0 Replaces `setLineColor`. Will return source line's color if
  auto.
- 8.4.0 Added `isLabel` parameter.
- 9.1.2 Changed name of `isLabel` parameter to `ignoreHighlight`.

Inherited From:  
- [CIQ.Drawing#getLineColor](CIQ.Drawing.html#getLineColor)

Overrides:  
- [CIQ.Drawing.vertical#getLineColor](CIQ.Drawing.vertical.html#getLineColor)

##### Returns:

Color to use for the line drawing

Type  
string

##### Example

``` javascript
var trendLineColor=this.getLineColor();
        this.stx.plotLine(x0, x1, y0, y1, trendLineColor, "segment", context, panel, parameters);
```

#### highlight(highlighted)

Returns the highlighted state. Set this.highlighted to the highlight
state. For simple drawings the highlighted state is just true or false.
For complex drawings with pivot points for instance, the highlighted
state may have more than two states. Whenever the highlighted state
changes a draw() event will be triggered.

##### Parameters:

| Name          | Type    | Description                                         |
|---------------|---------|-----------------------------------------------------|
| `highlighted` | boolean | True to highlight the drawing, false to unhighlight |

Inherited From:  
- [CIQ.Drawing#highlight](CIQ.Drawing.html#highlight)

Overrides:  
- [CIQ.Drawing.vertical#highlight](CIQ.Drawing.vertical.html#highlight)

##### Returns:

State of drawing - true for highlighted.

Type  
boolean

#### intersected(tick, value, box)

Called to determine whether the drawing is intersected by either the
tick/value (pointer location) or box (small box surrounding the
pointer). For line-based drawings, the box should be checked. For area
drawings (rectangles, circles) the point should be checked.

##### Parameters:

| Name    | Type   | Description                                                                 |
|---------|--------|-----------------------------------------------------------------------------|
| `tick`  | number | The tick in the `dataSet` representing the cursor point.                    |
| `value` | number | The value (price) representing the cursor point.                            |
| `box`   | object | x0, y0, x1, y1, r representing an area around the cursor, including radius. |

Inherited From:  
- [CIQ.Drawing#intersected](CIQ.Drawing.html#intersected)

Overrides:  
- [CIQ.Drawing.vertical#intersected](CIQ.Drawing.vertical.html#intersected)

##### Returns:

An object that contains information about the intersection. This object
is passed back to CIQ.Drawing.reposition when repositioning the drawing.
Return false or null if not intersected. Simply returning true
highlights the drawing.

Type  
object \| undefined

#### isAllowed(stx \[, field\])

Decides if a drawing can be created on the specified field.

##### Parameters:

| Name    | Type                                    | Argument     | Description                                            |
|---------|-----------------------------------------|--------------|--------------------------------------------------------|
| `stx`   | [CIQ.ChartEngine](CIQ.ChartEngine.html) |              | The chart object.                                      |
| `field` | string                                  | \<optional\> | Field in the dataset, if something other than default. |

Since:  
- 8.6.0

Inherited From:  
- [CIQ.Drawing#isAllowed](CIQ.Drawing.html#isAllowed)

Overrides:  
- [CIQ.Drawing.vertical#isAllowed](CIQ.Drawing.vertical.html#isAllowed)

##### Returns:

Whether a drawing can be made on the field.

Type  
boolean

#### measure()

Should call this.stx.setMeasure() with the measurements of the drawing
if supported.

Inherited From:  
- [CIQ.Drawing#measure](CIQ.Drawing.html#measure)

Overrides:  
- [CIQ.Drawing.vertical#measure](CIQ.Drawing.vertical.html#measure)

#### move(context, tick, value)

Called when the user moves while creating a drawing.

##### Parameters:

| Name      | Type                                                                        | Description                        |
|-----------|-----------------------------------------------------------------------------|------------------------------------|
| `context` | [external:CanvasRenderingContext2D](external-CanvasRenderingContext2D.html) | Canvas context on which to render. |
| `tick`    | number                                                                      | Tick in the `dataSet`.             |
| `value`   | number                                                                      | Value at position.                 |

Inherited From:  
- [CIQ.Drawing#move](CIQ.Drawing.html#move)

Overrides:  
- [CIQ.Drawing.vertical#move](CIQ.Drawing.vertical.html#move)

#### pixelFromValue(panel, tick, value \[, yAxis\])

Returns the Y pixel location for the (split) unadjusted price rather
than the displayed price for a drawing. This is important for drawing
tools or any other device that requires the actual underlying price.
This function is preferred over
[CIQ.ChartEngine#pixelFromValueAdjusted](CIQ.ChartEngine.html#pixelFromValueAdjusted)
when used by drawing functions because it automatically returns the
pixel based off the value of the plot corresponding the drawing's
`field` property.
[CIQ.ChartEngine#pixelFromValueAdjusted](CIQ.ChartEngine.html#pixelFromValueAdjusted)
usually returns the pixel of the main series plot's value.

##### Parameters:

| Name    | Type                                                | Argument     | Description                                                       |
|---------|-----------------------------------------------------|--------------|-------------------------------------------------------------------|
| `panel` | [CIQ.ChartEngine.Panel](CIQ.ChartEngine.Panel.html) |              | The panel to get the value from                                   |
| `tick`  | number                                              |              | The tick location (in the dataSet) to check for an adjusted value |
| `value` | number                                              |              | The value                                                         |
| `yAxis` | [CIQ.ChartEngine.YAxis](CIQ.ChartEngine.YAxis.html) | \<optional\> | The yaxis to use                                                  |

Since:  
- 8.4.0

Inherited From:  
- [CIQ.Drawing#pixelFromValue](CIQ.Drawing.html#pixelFromValue)

Overrides:  
- [CIQ.Drawing.vertical#pixelFromValue](CIQ.Drawing.vertical.html#pixelFromValue)

##### Returns:

The pixel location of the plot whose field matches the field property of
the drawing

Type  
number

#### pointIntersection(tick, value, box, isPixels)

Returns true if the tick and value are inside the box

##### Parameters:

| Name       | Type    | Description                                                                                                                |
|------------|---------|----------------------------------------------------------------------------------------------------------------------------|
| `tick`     | number  | The tick                                                                                                                   |
| `value`    | number  | The value                                                                                                                  |
| `box`      | object  | The box                                                                                                                    |
| `isPixels` | boolean | True if tick and value are in pixels; otherwise, they assumed to be in ticks and untransformed y-axis values, respectively |

Since:  
- 7.0.0 Added `isPixels`.

Inherited From:  
- [CIQ.Drawing#pointIntersection](CIQ.Drawing.html#pointIntersection)

Overrides:  
- [CIQ.Drawing.vertical#pointIntersection](CIQ.Drawing.vertical.html#pointIntersection)

##### Returns:

True if the tick and value are within the box

Type  
boolean

#### reconstruct(stx \[, obj\])

Reconstruct a horizontal

##### Parameters:

<table class="params table table-striped">
<colgroup>
<col style="width: 25%" />
<col style="width: 25%" />
<col style="width: 25%" />
<col style="width: 25%" />
</colgroup>
<thead>
<tr class="header">
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td class="name"><code>stx</code></td>
<td class="type"><a href="CIQ.ChartEngine.html">CIQ.ChartEngine</a></td>
<td class="attributes"></td>
<td class="description last"><p>The chart object</p></td>
</tr>
<tr class="even">
<td class="name"><code>obj</code></td>
<td class="type">object</td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"><p>A drawing descriptor</p>
<h6>Properties</h6>
<table class="params table table-striped">
<colgroup>
<col style="width: 25%" />
<col style="width: 25%" />
<col style="width: 25%" />
<col style="width: 25%" />
</colgroup>
<thead>
<tr class="header">
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td class="name"><code>col</code></td>
<td class="type">string</td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"><p>The line color</p></td>
</tr>
<tr class="even">
<td class="name"><code>pnl</code></td>
<td class="type">string</td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"><p>The panel name</p></td>
</tr>
<tr class="odd">
<td class="name"><code>ptrn</code></td>
<td class="type">string</td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"><p>Optional pattern for line
"solid","dotted","dashed". Defaults to solid.</p></td>
</tr>
<tr class="even">
<td class="name"><code>lw</code></td>
<td class="type">number</td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"><p>Optional line width. Defaults to
1.</p></td>
</tr>
<tr class="odd">
<td class="name"><code>v0</code></td>
<td class="type">number</td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"><p>Value (price) for the first
point</p></td>
</tr>
<tr class="even">
<td class="name"><code>d0</code></td>
<td class="type">number</td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"><p>Date (string form) for the first
point</p></td>
</tr>
<tr class="odd">
<td class="name"><code>al</code></td>
<td class="type">boolean</td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"><p>True to include an axis label</p></td>
</tr>
<tr class="even">
<td class="name"><code>tzo0</code></td>
<td class="type">number</td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"><p>Offset of UTC from d0 in
minutes</p></td>
</tr>
<tr class="odd">
<td class="name"><code>fld</code></td>
<td class="type">string</td>
<td class="attributes">&lt;optional&gt;</td>
<td class="description last"><p>Field which drawing is associated
with</p></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>

Since:  
- 8.4.0 Added `fld` property to `obj` parameter.

Inherited From:  
- [CIQ.Drawing.horizontal#reconstruct](CIQ.Drawing.horizontal.html#reconstruct)

Overrides:  
- [CIQ.Drawing.vertical#reconstruct](CIQ.Drawing.vertical.html#reconstruct)

#### render(context)

Called to render the drawing.

##### Parameters:

| Name      | Type                                                                        | Description                        |
|-----------|-----------------------------------------------------------------------------|------------------------------------|
| `context` | [external:CanvasRenderingContext2D](external-CanvasRenderingContext2D.html) | Canvas context on which to render. |

Inherited From:  
- [CIQ.Drawing#render](CIQ.Drawing.html#render)

Overrides:  
- [CIQ.Drawing.vertical#render](CIQ.Drawing.vertical.html#render)

#### reposition(context, repositioner, tick, value)

Called when the user attempts to reposition a drawing. The repositioner
is the object provided by CIQ.Drawing.intersected and can be used to
determine which aspect of the drawing is being repositioned. For
instance, this object may indicate which point on the drawing was
selected by the user. It might also contain the original coordinates of
the point or anything else that is useful to render the drawing.

##### Parameters:

| Name           | Type   | Description                                          |
|----------------|--------|------------------------------------------------------|
| `context`      | object | The canvas context.                                  |
| `repositioner` | object | The repositioner object.                             |
| `tick`         | number | Current tick in the `dataSet` for the mouse cursor.  |
| `value`        | number | Current value in the `dataSet` for the mouse cursor. |

Inherited From:  
- [CIQ.Drawing#reposition](CIQ.Drawing.html#reposition)

Overrides:  
- [CIQ.Drawing.vertical#reposition](CIQ.Drawing.vertical.html#reposition)

#### serialize()

Serialize a drawing into an object.

Inherited From:  
- [CIQ.Drawing#serialize](CIQ.Drawing.html#serialize)

Overrides:  
- [CIQ.Drawing.vertical#serialize](CIQ.Drawing.vertical.html#serialize)

#### setLineColor()

Compute the proper color to use when rendering lines in the drawing.

Since:  
- 4.0.0
- 7.0.0 Deprecated

Inherited From:  
- [CIQ.Drawing#setLineColor](CIQ.Drawing.html#setLineColor)

Overrides:  
- [CIQ.Drawing.vertical#setLineColor](CIQ.Drawing.vertical.html#setLineColor)

Deprecated:  
- Use [CIQ.Drawing#getLineColor](CIQ.Drawing.html#getLineColor) instead.

##### Returns:

color

Type  
string \| null

#### setPoint(point, x, y \[, chart\])

Sets the internal properties of the drawing points where x is a tick or
a date and y is a value.

##### Parameters:

| Name    | Type                                                | Argument     | Description                                                  |
|---------|-----------------------------------------------------|--------------|--------------------------------------------------------------|
| `point` | number                                              |              | index to point to be converted (0,1)                         |
| `x`     | number \| string                                    |              | index of bar in dataSet (tick) or date of tick (string form) |
| `y`     | number                                              |              | price                                                        |
| `chart` | [CIQ.ChartEngine.Chart](CIQ.ChartEngine.Chart.html) | \<optional\> | Optional chart object                                        |

Since:  
- 04-2015
- 8.3.0 `x` tick values outside an allowable range will be replaced by
  values at the edge of the range. This is to prevent performance
  problems when switching periodicities.

Inherited From:  
- [CIQ.Drawing#setPoint](CIQ.Drawing.html#setPoint)

Overrides:  
- [CIQ.Drawing.vertical#setPoint](CIQ.Drawing.vertical.html#setPoint)

#### valueFromPixel(pixel \[, panel\] \[, yAxis\])

Returns the value (price) of a drawing given a y-axispixel. The value is
relative to the panel or the canvas. This function is preferred over
[CIQ.ChartEngine#valueFromPixel](CIQ.ChartEngine.html#valueFromPixel)
when used by drawing functions because it automatically returns the
value based off the plot corresponding the drawing's `field` property.
[CIQ.ChartEngine#valueFromPixel](CIQ.ChartEngine.html#valueFromPixel)
usually returns the value of the main series plot.

##### Parameters:

| Name    | Type                                                | Argument     | Description                                                                                                                                                           |
|---------|-----------------------------------------------------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `pixel` | number                                              |              | The y pixel position                                                                                                                                                  |
| `panel` | [CIQ.ChartEngine.Panel](CIQ.ChartEngine.Panel.html) | \<optional\> | A panel object. If passed then the value will be relative to that panel. If not passed then the value will be relative to the panel that is in the actual Y location. |
| `yAxis` | [CIQ.ChartEngine.YAxis](CIQ.ChartEngine.YAxis.html) | \<optional\> | Which yAxis. Defaults to panel.yAxis.                                                                                                                                 |

Since:  
- 8.4.0

Inherited From:  
- [CIQ.Drawing#valueFromPixel](CIQ.Drawing.html#valueFromPixel)

Overrides:  
- [CIQ.Drawing.vertical#valueFromPixel](CIQ.Drawing.vertical.html#valueFromPixel)

##### Returns:

The value relative to the panel, of the plot whose field matches the
field property of the drawing

Type  
number
