Sparkline
Simplified area chart to show trends
Source
LLM docs
Docs
PackageIcon
Usage
Sparkline is a simplified version of AreaChart. It can be used
to display a single series of data in a small space.
Color
Fill opacity
Stroke width
Change area color depending on color scheme
You can use CSS variables in the color property. To define a CSS variable that
changes depending on the color scheme, use light/dark mixins
or the light-dark function. Example
of an area that is dark orange in light mode and lime in dark mode:
Trend colors
Use the trendColors prop instead of color to change the chart color depending on the trend.
The prop accepts an object with positive, negative, and neutral properties:
positive- color for positive trend (first value is less than the last value in thedataarray)negative- color for negative trend (first value is greater than the last value in thedataarray)neutral- color for neutral trend (first and last values are equal)
neutral is optional; if not provided, the color will be the same as positive.
Positive trend:
Negative trend:
Neutral trend: