+++
# -----------------------------------------------------------------------
# Do not edit this file. It is automatically generated by API Documenter.
# -----------------------------------------------------------------------
title = "ConstantVector"
keywords = ["grafana","documentation","sdk","@grafana/data"]
type = "docs"
+++

## ConstantVector class

<b>Signature</b>

```typescript
export declare class ConstantVector<T = any> implements Vector<T> 
```
<b>Import</b>

```typescript
import { ConstantVector } from '@grafana/data';
```
<b>Constructors</b>

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [constructor(value, len)](#constructor-valuelen) |  | Constructs a new instance of the <code>ConstantVector</code> class |

<b>Properties</b>

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [length](#length-property) |  | <code>number</code> |  |

<b>Methods</b>

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [get(index)](#get-method) |  |  |
|  [toArray()](#toarray-method) |  |  |
|  [toJSON()](#tojson-method) |  |  |

### constructor(value, len)

Constructs a new instance of the `ConstantVector` class

<b>Signature</b>

```typescript
constructor(value: T, len: number);
```
<b>Parameters</b>

|  Parameter | Type | Description |
|  --- | --- | --- |
|  value | <code>T</code> |  |
|  len | <code>number</code> |  |

### length property

<b>Signature</b>

```typescript
get length(): number;
```

### get method

<b>Signature</b>

```typescript
get(index: number): T;
```
<b>Parameters</b>

|  Parameter | Type | Description |
|  --- | --- | --- |
|  index | <code>number</code> |  |

<b>Returns:</b>

`T`

### toArray method

<b>Signature</b>

```typescript
toArray(): T[];
```
<b>Returns:</b>

`T[]`

### toJSON method

<b>Signature</b>

```typescript
toJSON(): T[];
```
<b>Returns:</b>

`T[]`

