Google Sheets Course: Sparkline Charts
A Sparkline chart is a mini chart inserted directly in a cell.
In Google Sheets, the Sparkline chart is available as a function.
Insert a Sparkline chart
To create a Sparkline chart, insert the SPARKLINE function and select the source data:
![google sheets insertion chart sparkline](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-insertion-chart-sparkline.png)
The chart is then inserted in the cell and gives you a visual preview of the different amounts to its left:
![google sheets chart sparkline](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-chart-sparkline.png)
Since it's a function, you can copy it:
![google sheets chart sparkline copy](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-chart-sparkline-copy.png)
To get:
![google sheets charts sparkline](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-charts-sparkline.png)
Customize a Sparkline chart
To get a customized version of the Sparkline chart, you need to enter one or more parameters (separated by ;
) between {}
as the second argument.
For example:
=SPARKLINE(B2:G2,{"charttype","line"})
The types of Sparkline charts
The curve chart (by default):
=SPARKLINE(B2:G2,{"charttype","line"})
![google sheets chart sparkline line](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-chart-sparkline-line.png)
The stacked bar chart:
=SPARKLINE(B2:G2,{"charttype","bar"})
![google sheets chart sparkline bar](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-chart-sparkline-bar.png)
The column chart:
=SPARKLINE(B2:G2,{"charttype","column"})
![google sheets chart sparkline column](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-chart-sparkline-column.png)
The positive or negative chart:
=SPARKLINE(B2:G2,{"charttype","winloss"})
![google sheets chart sparkline winloss](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-chart-sparkline-winloss.png)
Color of Sparkline Charts
The column chart in green:
=SPARKLINE(B2:G2,{"charttype","column";"color","green"})
![google sheets chart sparkline column green](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-chart-sparkline-column-green.png)
You can enter a color by its name (green) or by its hexadecimal value (#008000).
The curve chart in pink:
=SPARKLINE(B2:G2,{"charttype","line";"color","#ff009a"})
![google sheets chart sparkline line pink](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-chart-sparkline-line-pink.png)
Here it is not necessary to specify the type since it is the default chart type:
=SPARKLINE(B2:G2,{"color","#ff009a"})
Color of the Minimum and Maximum
The column chart with the minimum in red and the maximum in green:
=SPARKLINE(B2:G2,{"charttype","column";"lowcolor","red";"highcolor","#00b100"})
![google sheets chart sparkline column green red](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-chart-sparkline-column-green-red.png)
Line Thickness
The curve chart with a thickness of 3:
=SPARKLINE(B2:G2,{"color","#00b1ff";"linewidth",3})
![google sheets chart sparkline thick line](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-chart-sparkline-thick-line.png)
Y Minimum and Maximum
The column chart with a defined Y range:
=SPARKLINE(B2:G2,{"charttype","column";"ymin",20000;"ymax",80000})
![google sheets sparkline min max](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-sparkline-min-max.png)
Bar Chart with Maximum
The bar chart with a maximum defined at 400000:
=SPARKLINE(B2:G2,{"charttype","bar";"max",400000})
![google sheets sparkline bar max](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-sparkline-bar-max.png)
To give the appearance of a sum, use a single color:
=SPARKLINE(B2:G2,{"charttype","bar";"max",400000;"color1","#65cd2c";"color2","#65cd2c"})
![google sheets sparkline bar sum](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-sparkline-bar-sum.png)
The version with a single value and a maximum defined at 60000:
=SPARKLINE(B2,{"charttype","bar";"max",60000})
![google sheets chart sparkline bar max](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-chart-sparkline-bar-max.png)
It is also possible to use functions to define the values of SPARKLINE parameters. For example, the maximum here is calculated using a function (then rounded to get a whole number):
=SPARKLINE(B2,{"charttype","bar";"max",ROUND(MAX(B$2:B$4))})
![google sheets chart sparkline max function](https://www.sheets-pratique.com/view/en/course/img/sparkline/google-sheets-chart-sparkline-max-function.png)
More Colors
A list of 729 colors that can be used with SPARKLINE is available here: list of colors
More Parameters
There are many other parameters to customize your Sparkline charts.
This list is available on Google's website: https://support.google.com/docs/answer/3093289