# Vari Sparkline

## Content

You can create a vari sparkline using the VARISPARKLINE formula and cell values.

![](https://gcdocumentsitekrblob.blob.core.windows.net/document-site-files/images/8d606653-16a0-474d-b9dc-e2b4d01c2446/images/sparkvari.png)

![](https://gcdocumentsitekrblob.blob.core.windows.net/document-site-files/images/8d606653-16a0-474d-b9dc-e2b4d01c2446/images/sparkvari2.png)

The vari sparkline has the following options:

| **Option** | **Description** |
| ------ | ----------- |
| variance | A number or reference that represents the bar length, such as 2 or "A1". |
| reference | A number or reference that represents the location of the reference line, such as 0 or "A2". This setting is optional. The default value is 0. |
| mini | A number or reference that represents the minimum value of the sparkline, such as -5 or "A3". This setting is optional. The default value is -1. |
| maxi | A number or reference that represents the maximum value of the sparkline, such as 5 or "A4". This setting is optional. The default value is 1. |
| mark | A number or reference that represents the position of the mark line, such as 3 or "A5". This setting is optional. |
| tickunit | A number or reference that represents a tick unit, such as 1 or "A6". This setting is optional. The default value is 0. |
| legend | A boolean that represents whether to display the text. The default is optional. The default value is FALSE. |
| colorPositive | A string that represents the color scheme for variance and is larger than the reference. This setting is optional. The default value is "green". |
| colorNegative | A string that represents the color scheme for variance and is smaller than the reference. This setting is optional. The default value is "red". |
| vertical | A boolean that represents whether to display the sparkline vertically. This setting is optional. The default value is FALSE. |

The vari sparkline formula has the following format:
`=VARISPARKLINE(variance, reference, mini, maxi, mark, tickunit, legend, colorPositive, colorNegative, vertical)`

The following code sample creates vari sparklines.

```javascript
activeSheet.setFormula(0,1,'=VARISPARKLINE(3,0,-5,5,0.5,0.5,TRUE,"green","red",FALSE)');
activeSheet.setFormula(0,0,'=VARISPARKLINE(-3,3,-5,5,0.5,0.5,TRUE,"green","red",TRUE)');
```