grafana/docs/sources/packages_api/data/formattedvector.md

105 lines
2.0 KiB
Markdown
Raw Normal View History

+++
# -----------------------------------------------------------------------
# Do not edit this file. It is automatically generated by API Documenter.
# -----------------------------------------------------------------------
title = "FormattedVector"
keywords = ["grafana","documentation","sdk","@grafana/data"]
type = "docs"
+++
## FormattedVector class
<b>Signature</b>
```typescript
export declare class FormattedVector<T = any> implements Vector<string>
```
<b>Import</b>
```typescript
import { FormattedVector } from '@grafana/data';
```
<b>Constructors</b>
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [constructor(source, formatter)](#constructor-sourceformatter) | | Constructs a new instance of the <code>FormattedVector</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(source, formatter)
Constructs a new instance of the `FormattedVector` class
<b>Signature</b>
```typescript
constructor(source: Vector<T>, formatter: DisplayProcessor);
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| source | <code>Vector&lt;T&gt;</code> | |
| formatter | <code>DisplayProcessor</code> | |
### length property
<b>Signature</b>
```typescript
get length(): number;
```
### get method
<b>Signature</b>
```typescript
get(index: number): string;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| index | <code>number</code> | |
<b>Returns:</b>
`string`
### toArray method
<b>Signature</b>
```typescript
toArray(): string[];
```
<b>Returns:</b>
`string[]`
### toJSON method
<b>Signature</b>
```typescript
toJSON(): string[];
```
<b>Returns:</b>
`string[]`