---
title: "BasicBargraphs Collection"
canonical: "https://docs.cuesystem.com/space/CVCGC/401244171/BasicBargraphs%20Collection"
format: markdown
---
> Macro (toc)

---

# Description

Bargraphs are very common types of graphical objects suited for displaying qualitative independent values (temperature, volume, ...).

This graphic collection includes following objects

|  |  |  |
| --- | --- | --- |
| ![image](media://4c5e0938-2d44-4b33-a556-eb359f193073) | ![image](media://c99e2bec-dbd2-4a26-a463-aeba7ea425be) | ![image](media://1c6fc537-5402-4fb3-8175-4355acc88a8e) |
| [HorizontalBargraph ](https://cue.atlassian.net/wiki/spaces/CVCGC/pages/403144709) | [VerticalBargraph](https://cue.atlassian.net/wiki/spaces/CVCGC/pages/402522164) | [Thermometer](https://cue.atlassian.net/wiki/spaces/CVCGC/pages/402325540) |

Bargraphs have 4 different sizes (width for vertical, height for horizontal), 40, 60, 80 and 100 pixels. If another size is set, it is automatically changed to the nearest lower value (or minimum). If the length of the bargraph (height for vertical, width for horizontal) is smaller then displayable, it is automatically changed to the smallest displayable length.

 The following figure describes the basic parts of bargraph.

![image](media://261fbadc-b65d-4dbb-9a75-6c7db028f7ce)

# Common Properties

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Behavior |
| DefaultValue | Double | Any | (Maximum +   
Minimum) / 2 | Initial value of bargraph flood after reset |
| Appearance |
| FloodColor | Long | 1 = Blue<br>2 = Green<br>3 = Yellow<br>4 = Orange<br>5 = Purple | 1 | Color of flood |
| FloodType | Long | 1 = left to right, bottom to top   
2 = right to left, top to bottom | 1 | Direction of flood |
| Scale |
| DivisionInterval | Double | > 0 | 10 | Interval between two scale divisions |
| Maximum | Double | <> Minimum | 100 | Value of right (top) end of bargraph scale |
| Minimum | Double | <> Maximum | 0 | Value of left (bottom) end of bargraph scale |
| OriginPosition | Double | In interval between Minimum and Maximum | 50 | Value, from which scale is drawn |
| ShowOrigin | Boolean | Any | True | Highlight of origin position |
| SubdivisionsCount | Long | >=1 | 5 | Number of subdivisions between two divisions |

# Common Functions

## SetDivisionInterval 

This function sets interval between two scale divisions. The function returns True on success. It returns False if an error occurs (parameter is too small). In this case DivisionInterval is set internally to reasonable small value (the value depends on display resolution and display size).

#### Syntax

```visualbasic
Function SetDivisionInterval(newdivisioninterval As Double) As Boolean
```

## GetDivisionInterval

This function returns interval between two divisions.

#### Syntax

```visualbasic
Function GetDivisionInterval() As Double
```

## SetFloodColor 

This function sets color of bargraph flood to newfloodcolor. 

#### Syntax

```visualbasic
Function SetFloodColor(newfloodcolor As Long) As Boolean
```

Possible values are

- 1 = Blue
- 2 = Green
- 3 = Yellow
- 4 = Orange
- 5 = Purple

The function returns True on success or False if an error occurs (parameter is out of limits).

## GetFloodColor

This function returns current flood color of bargraph. For possible values see command SetFloodColor.

#### Syntax

```visualbasic
Function GetFloodColor() As Long
```

## SetFloodType

This function sets type (direction) of bargraph flood. 

#### Syntax

```visualbasic
Function SetFloodType(newfloodtype As Long) As Boolean
```

Possible values are:

1 = left to right (bottom to top)   
2 = right to left (top to bottom)

The function returns True on success or False if an error occurs (parameter is out of limits).

## GetFloodType

This function returns current flood type (direction) of bargraph. For possible values see command SetFloodType.

#### Syntax

```visualbasic
Function GetFloodType() As Long
```

## SetMaximum

This function sets Maximum of bargraph scale to newmaximum. It returns True, if newmaximum is not equal to current Minimum. Otherwise it returns False, bargraph scale disappears and flood is set to full flood or no flood. In both cases newmaximum is stored in object memory.

#### Syntax

```visualbasic
Function SetMaximum(newmaximum As Double) As Boolean
```

## GetMaximum

This function returns value of right (top) end of bargraph scale.

#### Syntax

```visualbasic
Function GetMaximum() As Double
```

## SetMinimum

This function sets Minimum of bargraph scale to newminimum. It returns True, if newminimum is not equal to current Maximum. Otherwise it returns False, bargraph scale disappears and flood is set to full flood or no flood. In both cases newminimum is stored in object memory.

#### Syntax

```visualbasic
Function SetMinimum(newminimum As Double) As Boolean
```

## GetMinimum

This function returns value of left (bottom) end of bargraph scale.

#### Syntax

```visualbasic
Function GetMinimum() As Double
```

## SetOriginPosition

This function sets the value, from which scale is drawn to neworiginposition. It returns True, if neworiginposition is in range between current Minimum and Maximum. Otherwise it returns False and bargraph scale disappears. In both cases neworiginposition is stored in object memory.

#### Syntax

```visualbasic
Function SetOriginPosition(neworiginposition As Double) As Boolean
```

## GetOriginPosition

This function returns value, from which scale is drawn.

#### Syntax

```visualbasic
Function GetOriginPosition() As Double
```

## SetScale 

This function sets all parameters of scale (newminimum, newmaximum, neworiginposition, newdivisioninterval, newsubdivisionscount) in one command. If optional parameters (newdivisioninterval, newsubdivisionscount) are not used in this function, these parameters are not changed. The function returns True on success or False if an error occurs (parameter is out of limits). In both cases parameters are stored in object memory. For valid value of specific parameters see functions above.

#### Syntax

```visualbasic
Function SetScale(
  newminimum As Double, 
  newmaximum As Double, 
  neworiginposition As Double, 
  Optional newdivisioninterval As Double, 
  Optional newsubdivisionscount As Long) 
As Boolean
```

## SetShowOrigin

This function sets whether origin position is highlighted or not.

#### Syntax

```visualbasic
Function SetShowOrigin(newshoworigin As Boolean)
```

## GetShowOrigin 

This function returns whether origin position is highlighted or not.

#### Syntax

```visualbasic
Function GetShowOrigin() As Boolean
```

## SetSubdivisionsCount 

This function sets number of subdivisions between two divisions. The function returns True on success. It returns False if an error occurs (parameter is less then 1). In this case SubdivisionCount is set to 1 internally.

#### Syntax

```visualbasic
Function SetSubdivisionsCount(newsubdivisioncount As Long) As Boolean
```

## GetSubdivisionsCount

This function returns number of subdivisions between two divisions.

#### Syntax

```visualbasic
Function GetSubdivisionsCount() As Long
```

## SetValue 

This function sets value of bargraph. It returns True, if newvalue is in range Minimum – Maximum, otherwise, it returns False and sets flood to full flood or no flood. In both cases newvalue is stored in object memory.

#### Syntax

```visualbasic
Function SetValue(newvalue As Double) As Boolean
```

## GetValue

This function returns current value of bargraph.

#### Syntax

```visualbasic
Function GetValue() As Double
```