﻿ Area Sparkline | Spread Windows Forms 17
In This Topic
Area Sparkline
In This Topic

Area sparklines are presented as a line sparkline graph in which the area between the series and the X axis is filled with color. You can create an area sparkline by using the AREASPARKLINE formula.

The area sparkline formula has the following syntax:

`=AREASPARKLINE(points, [min, max, line1, line2, colorPositive, colorNegative, lineColor])`

The formula options are described below:

 Option Description points A cell range. Invalid values are treated as 0. min Optional A number that represents the minimum value of the sparkline. max Optional A number that represents the maximum value of the sparkline. line1 Optional A number that represents a horizontal line's vertical position. line2 Optional A number that represents a second horizontal line's vertical position. colorPositive Optional A string that represents the area color of positive values. colorNegative Optional A string that represents the area color of negative values. lineColor Optional A string that represents the color of the line.
Note: In case value of line is smaller than the actual minimum value, the line will not be painted.

### Usage Scenario

Consider a scenario where an entertainment-focused website displays the number of monthly subscribers gained by US-based streaming services. An area sparkline can show the fluctuation throughout the first six months of the year and compare the viewership obtained by those services.

C#
Copy Code
```// Get sheet

// Set data
{
{"Stream","January","February","March","April","May","June", "Diagram"},
{ "Netflix",323123,245631,122398,345341,327831,234234, null},
{ "Prime Video",214352,23454,545656,712433,273911,349034, null},
{ "Disney Hotstar",234234,123435,432534,343454,345343,636349, null},
{ "HBO",726326,634523,374000,678300,700028,602090, null},
{ "Hulu",52692,32423,12383,45376,30019,26001,null}
});

// Set backColor for cells

// Set AreaSparkline formula
worksheet.Cells["H3:H7"].Formula = "Areasparkline(A3:F3,,,0,100000,\"#E9958E\",\"#f7a711\")";
```
Visual Basic
Copy Code
```'Get sheet

'Set data
worksheet.SetValue(1, 0, New Object(,) {
{"Stream", "January", "February", "March", "April", "May", "June", "Diagram"},
{"Netflix", 323123, 245631, 122398, 345341, 327831, 234234, Nothing},
{"Prime Video", 214352, 23454, 545656, 712433, 273911, 349034, Nothing},
{"Disney Hotstar", 234234, 123435, 432534, 343454, 345343, 636349, Nothing},
{"HBO", 726326, 634523, 374000, 678300, 700028, 602090, Nothing},
{"Hulu", 52692, 32423, 12383, 45376, 30019, 26001, Nothing}})

'Set backColor for cells

'Set AreaSparkline formula
worksheet.Cells("H3:H7").Formula = "Areasparkline(A3:F3,,,0,100000,""#E9958E"",""#f7a711"")"
```