---
name: "getGraphValues"
type: command
status: ok
groups: ["Math"]
arma3_since: "1.92"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/getGraphValues
revid: 351320
updated: 2023-11-27T05:02:35Z
---

# getGraphValues

*Command · Math · Arma 3 v1.92*

## Description

Generate graph y - coordinates of all input values within specific x and y range.

## Syntax

```sqf
getGraphValues [[graphMinX, graphMaxX, graphMinY, graphMaxY, valueCount, randomOffset], x1, y1, x2, y2, ...]
```

**Parameters:**

- `graphMinX`: [Number](../topics/Number.md) - minimum x-axis value
- `graphMaxX`: [Number](../topics/Number.md) - maximum x-axis value
- `graphMinY`: [Number](../topics/Number.md) - minimum y-axis value
- `graphMaxY`: [Number](../topics/Number.md) - maximum y-axis value
- `valueCount`: [Number](../topics/Number.md) - number of values the returned array should have
- `randomOffset`: [Number](../topics/Number.md) - random range for returned y value
- `xN`: [Number](../topics/Number.md) - nth x value
- `yN`: [Number](../topics/Number.md) - nth y value

**Returns:** [Array](../topics/Array.md) of [Array](../topics/Array.md) of [Number](../topics/Number.md)s - to format [arrayOfYvalues, arrayOfXvalues]

## Examples

### Example 1

```sqf
private _minX = 0;
private _maxX = 10;
private _minY = 0;
private _maxY = 100;
private _count = 11;
private _random = 0;

getGraphValues [
    [_minX, _maxX, _minY, _maxY, _count, _random],
    0, 5,
    1, 10,
    2, 100,
    3, 50,
    4, 30,
    5, 100,
    6, 10,
    7, 50,
    8, 75,
    9, 100,
    10, 100
];
/*
    returns [[0.05, 0.1, 1, 0.5, 0.3, 1, 0.1, 0.5, 0.75, 1, 1], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]
    supposedly [array of 1-based Y values, array of X values]
*/
```

## See also

[decayGraphValues](../commands/decayGraphValues.md)

<sub>Source: [BI Community Wiki — getGraphValues](https://community.bistudio.com/wiki/getGraphValues) (revision 351320).</sub>
