Sparkline
A Sparkline in REAVIZ is a small, condensed, and simplified line chart that provides a snapshot of data trends within a compact space, without axes or labels. It is designed for quick and immediate comprehension of data trends, making it ideal for presenting patterns and changes at a glance within limited space.
Types supported in reaviz:
- Line - Displays data trends as a simple line.
- Area - Similar to a line sparkline but with the area under the line filled.
- Bar - Displays data trends as a series of bars.
- Sonar - A unique representation often used for tracking and sonar-like visualizations.
Where to use:
- Concise Data Visualization: Ideal for displaying data trends in a compact space.
- Quick Trend Comprehension: Useful for providing immediate insight into data trends without specific data points or labels.
- Minimalist Design: Great for incorporating into text, tables, or dashboards where space is limited.
Quick Start
To create a Sparkline, import the chart of your choice SparklineChart, AreaSparklineChart, BarSparklineChart or SonarChart and
provide th data. The chart will automatically configure itself with the default options exposed via props.
Examples
Line
Area
Bar
Sonar
API
Sparkline Chartβ
| Prop | Description | Default |
|---|---|---|
data | Data the chart will receive to render.ChartShallowDataShape[] | |
series | The series component that renders the area/line/circles components.ReactElement<AreaSeriesProps, FC<Partial<AreaSeriesProps>>> | |
yAxis | The linear axis component for the Y Axis of the chart.ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>> | |
xAxis | The linear axis component for the X Axis of the chart.ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>> | |
gridlines | The chart's background gridlines component.ReactElement<GridlineSeriesProps, FC<Partial<GridlineSeriesProps>>> | |
brush | The chart's brush component.ReactElement<ChartBrushProps, FC<Partial<ChartBrushProps>>> | |
zoomPan | The chart's zoom pan component.ReactElement<ChartZoomPanProps, FC<Partial<ChartZoomPanProps>>> | |
secondaryAxis | Any secondary axis components. Useful for multi-axis charts.ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>[] | |
id | Id of the chart.string | |
width | Width of the chart. If not provided will autosize.number | |
height | Height of the chart. If not provided will autosize.number | |
margins | Margins for the chart.Margins | |
className | Classnames for the chart.string | |
containerClassName | Classnames for the chart.string | |
style | Additional css styles.StyleHTMLAttributes<SVGSVGElement> | |
center | Center the chart. Used mainly internally.boolean | |
centerX | Center chart on X Axis only. Used mainly internally.boolean | |
centerY | Center chart on Y Axis only. Used mainly internally.boolean |
Sonar Chartβ
| Prop | Description | Default |
|---|---|---|
data | Data the chart will receive to render.ChartNestedDataShape[] | |
series | The series component that renders the bar components.ReactElement<BarSeriesProps, FC<Partial<BarSeriesProps>>> | |
yAxis | The linear axis component for the Y Axis of the chart.ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>> | |
xAxis | The linear axis component for the X Axis of the chart.ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>> | |
gridlines | The chart's background gridlines component.ReactElement<GridlineSeriesProps, FC<Partial<GridlineSeriesProps>>> | |
brush | The chart's brush component.ReactElement<ChartBrushProps, FC<Partial<ChartBrushProps>>> | |
secondaryAxis | Any secondary axis components. Useful for multi-axis charts.ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>[] | |
id | Id of the chart.string | |
width | Width of the chart. If not provided will autosize.number | |
height | Height of the chart. If not provided will autosize.number | |
margins | Margins for the chart.Margins | |
className | Classnames for the chart.string | |
containerClassName | Classnames for the chart.string | |
style | Additional css styles.StyleHTMLAttributes<SVGSVGElement> | |
center | Center the chart. Used mainly internally.boolean | |
centerX | Center chart on X Axis only. Used mainly internally.boolean | |
centerY | Center chart on Y Axis only. Used mainly internally.boolean |
BarSparkline Chartβ
| Prop | Description | Default |
|---|---|---|
data | Data the chart will receive to render.ChartShallowDataShape[] | |
series | The series component that renders the bar components.ReactElement<BarSeriesProps, FC<Partial<BarSeriesProps>>> | |
yAxis | The linear axis component for the Y Axis of the chart.ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>> | |
xAxis | The linear axis component for the X Axis of the chart.ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>> | |
gridlines | The chart's background gridlines component.ReactElement<GridlineSeriesProps, FC<Partial<GridlineSeriesProps>>> | |
brush | The chart's brush component.ReactElement<ChartBrushProps, FC<Partial<ChartBrushProps>>> | |
secondaryAxis | Any secondary axis components. Useful for multi-axis charts.ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>[] | |
id | Id of the chart.string | |
width | Width of the chart. If not provided will autosize.number | |
height | Height of the chart. If not provided will autosize.number | |
margins | Margins for the chart.Margins | |
className | Classnames for the chart.string | |
containerClassName | Classnames for the chart.string | |
style | Additional css styles.StyleHTMLAttributes<SVGSVGElement> | |
center | Center the chart. Used mainly internally.boolean | |
centerX | Center chart on X Axis only. Used mainly internally.boolean | |
centerY | Center chart on Y Axis only. Used mainly internally.boolean |
AreaSparkline Chartβ
| Prop | Description | Default |
|---|---|---|
data | Data the chart will receive to render.ChartShallowDataShape[] | |
series | The series component that renders the area/line/circles components.ReactElement<AreaSeriesProps, FC<Partial<AreaSeriesProps>>> | |
yAxis | The linear axis component for the Y Axis of the chart.ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>> | |
xAxis | The linear axis component for the X Axis of the chart.ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>> | |
gridlines | The chart's background gridlines component.ReactElement<GridlineSeriesProps, FC<Partial<GridlineSeriesProps>>> | |
brush | The chart's brush component.ReactElement<ChartBrushProps, FC<Partial<ChartBrushProps>>> | |
zoomPan | The chart's zoom pan component.ReactElement<ChartZoomPanProps, FC<Partial<ChartZoomPanProps>>> | |
secondaryAxis | Any secondary axis components. Useful for multi-axis charts.ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>[] | |
id | Id of the chart.string | |
width | Width of the chart. If not provided will autosize.number | |
height | Height of the chart. If not provided will autosize.number | |
margins | Margins for the chart.Margins | |
className | Classnames for the chart.string | |
containerClassName | Classnames for the chart.string | |
style | Additional css styles.StyleHTMLAttributes<SVGSVGElement> | |
center | Center the chart. Used mainly internally.boolean | |
centerX | Center chart on X Axis only. Used mainly internally.boolean | |
centerY | Center chart on Y Axis only. Used mainly internally.boolean |
Last updated on