---
title: "Description of Legend"
canonical: "https://docs.cuesystem.com/space/CVCGC/825458689/Description%20of%20Legend"
format: markdown
---
The legend object improves the readability of the chart, it contains a description of the data. The values are set using the SetLegendData function, which is inserted with the same structure as the Chart object. You can choose to display items vertically or horizontally.

![image](media://bbaabfe9-d17b-4327-94d9-2c7212843b4b)

![image](media://4d2bd1d2-1aab-4b4b-af2b-b43f6c5bb72c)

![image](media://b669d77a-b4a1-42bc-beb2-191810e75120)

![image](media://8bd7a849-6fc3-4c99-849e-0787813003e9)

# Properties

Size and position settings are the same as in other graphic objects. The default size is 200x100 pixels.

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Appearance |
| BackgroundColor | Long | Any | 0 | Color of background |
| Font | AddressOf _Font | Any | fntDefault16 | Font of texts |
| FontColor | Long | Any | _COLOR_BLACK | Color of font |
| DisplayType | Long | LEGEND_DISPLAYTYPE_VERTICAL := 1<br>LEGEND_DISPLAYTYPE_HORIZONTAL := 2 | LEGEND_DISPLAYTYPE_VERTICAL | Type of items display |

# Functions

## SetLegendData

This function sets ChartData to data. The function returns True on success or False if an error occurs.

#### Syntax 

```
Function SetLegendData(data As ChartDataStructure) As Boolean
```

[Descriptions of structures](https://cue.atlassian.net/wiki/spaces/CVCGC/pages/825065479/Description+of+Chart#Descriptions-of-structure)

## SetObjectPosition

This function sets the position of object to newx and newy values. The function returns True on success or False if an error occurs.

#### Syntax

```
Function SetObjectPosition(newx As Long, newy As Long) As Boolean
```

## GetObjectPosition

This function returns the current position of object in parameters currentx and currenty.

#### Syntax

```
Function GetObjectPosition(ByRef currentx As Long, currenty As Long)
```

## SetObjectDimensions

This function sets dimensions of object to newwidth and newheight values. The function returns True on success or False if an error occurs.

#### Syntax

```
Function SetObjectDimensions(newwidth As Long, newheight As Long) As Boolean
```

## GetObjectDimensions

This function returns current size of object in parameters currentwidth and currentheight.

#### Syntax

```
Function GetObjectDimensions(ByRef currentwidth As Long, ByRef currentheight As Long)
```

## ShowObject

This function shows object, property Visible is set to True.

#### Syntax

```
Function ShowObject()
```

## HideObject

This function hides object, property Visible is set to False.

#### Syntax

```
Function HideObject()
```