| liquid_chart | R Documentation |
A liquid fill gauge represents a single value as a circle filled with an
animated liquid up to the corresponding level. The fill rises smoothly on
load, two wave layers give the water a natural depth, and the label text
changes color at the water surface — appearing in textColor above
the water and in waveTextColor below it.
liquid_chart(
value,
label = NULL,
fillColor = "steelblue",
circleColor = NULL,
circleThickness = 0.05,
textColor = NULL,
waveTextColor = "white",
textSize = 0.38,
waveAmplitude = 0.09,
waveCount = 2,
waveSpeed = 1,
title = NULL,
titleFontSize = 14,
font = "Verdana, Geneva, Tahoma, sans-serif",
bgcol = "white",
width = NULL,
height = NULL
)
value |
Numeric. The fill level, between 0 and 1 (0 = empty, 1 = full). |
label |
Character. Text displayed in the center of the gauge. Defaults
to |
fillColor |
The color of the liquid. Defaults to |
circleColor |
The color of the outer ring. Defaults to
|
circleThickness |
Thickness of the outer ring as a fraction of the
circle radius. Defaults to |
textColor |
Color of the label text above the water surface. Defaults
to |
waveTextColor |
Color of the label text below (inside) the water
surface. Defaults to |
textSize |
Font size of the label as a fraction of the circle radius.
Defaults to |
waveAmplitude |
Height of the wave as a fraction of the circle radius.
Defaults to |
waveCount |
Number of full wave cycles visible across the circle.
Defaults to |
waveSpeed |
Speed of the horizontal wave animation. Higher values are
faster. Defaults to |
title |
Optional. A label displayed below the circle. |
titleFontSize |
Font size of the title in pixels. Defaults to |
font |
The font family used for all text. Defaults to
|
bgcol |
Background color of the SVG. Defaults to |
width |
Optional. The width of the SVG output. |
height |
Optional. The height of the SVG output. |
An animated SVG liquid fill gauge.
# Basic usage — 55% fill
liquid_chart(value = 0.55)
# Custom color and label
liquid_chart(
value = 0.72,
label = "72%",
fillColor = "#e67e22",
title = "Disk usage"
)
# Low fill with a raw value label
liquid_chart(
value = 0.28,
label = "28%",
fillColor = "tomato",
circleColor = "tomato",
textColor = "tomato",
waveTextColor = "white"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.