Hbar Sparklines
To create horizontal bar sparklines in the workbook:
-
Click Insert from the menu.
-
Click Sparkline and select the hbar sparkline under Bar Sparkline from the list.
-
In the HbarSparkline Setting dialog box:
-
Enter the number or reference that represents the length of the bar, such as 0.3 or "A1".
-
Select the color scheme. The default value is "gray".
-
Click OK.
-
-
The sparkline is displayed in the cell. Click the function to edit the sparkline parameters.
-
Set the parameters as described below and click OK.
The hbar sparkline formula has the following format:
=HBARSPARKLINE(value, colorScheme, axisVisible, barHeight)
-
Copy and paste the cell as needed to finalize your hbar sparklines.
Hbar sparkline parameter | Description |
---|---|
Value |
Number or reference that represents the length of the bar, such as 0.3 or "A1".
|
colorScheme | String that represents the color of the bar; the default value is "gray". |
axisVisible | (Optional) Boolean that represents whether to show the axis; the default value is true. |
barHeight | (Optional) Number that represents the percentage of bar height according to the cell height (value > 0 and value <= 1). |
LET function |
(Optional) You can add a LET function to set colors according to specific values with IF statements. For example: =LET(ref,B7,color,IF(ref>=0.8,"#092834",IF(ref>=0.6,"#347B98",IF(ref>0.4,"#66B032",IF(ref>=0.2,"#B2D732",IF(ref>=0,"#F0F7D4","red"))))),HBARSPARKLINE(ref,color)) |