Docs
📊 ⏐ Charts
Linear Gauge

Linear Gauge

A Linear Gauge in REAVIZ uses a linear scale to display a specific data point using a dial over a linear scale with defined limits. This type of gauge is ideal for showing how a value fits within a range.

Types supported by reaviz:

Where to use:

  • Display Single Values: Ideal for showing specific data points within a range.
  • Track Metrics: Useful for tracking metrics such as risk scores or performance indicators.
  • Compare Multiple Values: Great for comparing multiple values in a clear, linear format.

Quick Start

To create a Linear Gauge, use import the LinearGauge and give it data. The chart will automatically configure itself with the default options exposed via props.

In this example, we only pass one data object, however, we can pass multiples and it will distribute the values across them.

Examples

Single-series gauges

Multi-series gauges

API

LinearGauge (opens in a new tab)

PropDescriptionDefault
dataData the chart will receive to render.
ChartShallowDataShape<ChartDataTypes | [ChartDataTypes, ChartDataTypes]> | ChartShallowDataShape<ChartDataTypes | [...]>[]
seriesThe series component that renders the bar components.
ReactElement<LinearGaugeSeriesProps, FC<Partial<LinearGaugeSeriesProps>>>
<LinearGaugeSeries />
minValueMin value to scale on. Only applicable for single-series.
number
0
maxValueMax value to scale on. Only applicable for single-series.
number
100
idId of the chart.
string
widthWidth of the chart. If not provided will autosize.
number
heightHeight of the chart. If not provided will autosize.
number
marginsMargins for the chart.
Margins
classNameClassnames for the chart.
string
containerClassNameClassnames for the chart.
string
styleAdditional css styles.
StyleHTMLAttributes<SVGSVGElement>
centerCenter the chart. Used mainly internally.
boolean
centerXCenter chart on X Axis only. Used mainly internally.
boolean
centerYCenter chart on Y Axis only. Used mainly internally.
boolean

LinearGaugeSeries (opens in a new tab)

PropDescriptionDefault
heightHeight of the chart. Set by `LinearGauge` component.
number
widthWidth of the chart. Set by `LinearGauge` component.
number
isMultiSeriesWhether its a multi-series or not. Set by `LinearGauge` component.
boolean
barBar element. Only applicable for single series.
ReactElement<BarProps, FC<Partial<BarProps>>>
<LinearGaugeBar />
outerBarOuter bar element. Only applicable for single series.
ReactElement<LinearGaugeOuterBarProps, FC<Partial<LinearGaugeOuterBarProps>>>
<LinearGaugeOuterBar />
dataParsed data shape. Set internally by `BarChart`.
ChartInternalDataShape[]
idId of the bar chart. Set internally by `BarChart`.
string
xScaleD3 scale for X Axis. Set internally by `BarChart`.
any
yScaleD3 scale for Y Axis. Set internally by `BarChart`.
any
xScale1D3 scale for X Multi-Group Axis. Set internally by `BarChart`.
any
typeType of the chart.
BarType
colorSchemeColor scheme for the chart.
ColorSchemeType
animatedWhether the chart is animated or not.
boolean
paddingAmount of padding between each bar.
number
groupPaddingAmount of padding between each group.
number
isCategoricalWhether the chart is categorical or not. Set internally by `BarChart`.
boolean
layoutDirection of the chart
Direction
binSizeThe size of each bin/bucket in the bar chart.
number
tooltipTooltip for the chart area.
ReactElement<TooltipAreaProps, ForwardRefExoticComponent<Partial<TooltipAreaProps> & RefAttributes<any>>>
valueMarkersValue markers line for the chart.
ReactElement<LinearValueMarkerProps, FC<LinearValueMarkerProps>>[]

LinearGaugeBar (opens in a new tab)

PropDescriptionDefault
activeWhether the bar is active or not.
boolean
activeBrightnessChroma brightness factor to brighten the active bar. See https://gka.github.io/chroma.js/#color-brighten for more info.
number
xScaleD3 scale for X Axis. Set internally by `BarChart`.
any
yScaleD3 scale for Y Axis. Set internally by `BarChart`.
any
xScale1D3 scale for X Multi-Group Axis. Set internally by `BarChart`.
any
dataParsed data shape. Set internally by `BarChart`.
ChartInternalShallowDataShape
idId set internally by `BarChart`.
string
gradientGradient shades for the bar.
ReactElement<GradientProps, FC<Partial<GradientProps>>>
rxSVG rx attribute for the bar.
number
rySVG ry attribute for the bar.
number
widthWidth of the bar. Set internally by `BarSeries`.
number
paddingPadding for the bar groups.
number
barCountTotal number of bars used for animation. Set internally by `BarSeries`.
number
colorColor callback for the bar.
any
cursorCursor for the bar element.
string
barIndexIndex of the bar. Set internally by `BarSeries`.
number
groupIndexIndex of the group. Set internally by `BarSeries`.
number
animatedWhether to animate the enter/update/exit. Set internally by `BarSeries`.
boolean
isCategoricalWhether this is categorical chart or not. Set internally by `BarSeries`.
boolean
rangeLinesRangelines element. for the bar.
ReactElement<RangeLinesProps, FC<Partial<RangeLinesProps>>>
maskMask element for the bar.
ReactElement<MaskProps, FC<MaskProps>>
tooltipTooltip element.
ReactElement<ChartTooltipProps, FC<Partial<ChartTooltipProps>>>
( <ChartTooltip placement="top" content={(data) => ( <TooltipTemplate value={{ y: data.value, x: data.y }} /> )} /> )
layoutDirection of the chart. Set internally by `BarSeries`.
Direction
typeType of bar chart. Set internally by `BarSeries`.
BarType
labelLabel element.
ReactElement<BarLabelProps, FC<Partial<BarLabelProps>>>
guideGuide bar component.
ReactElement<GuideBarProps, FC<Partial<GuideBarProps>>>
minHeightForce a min height on the bar.
number
glowGlow styling for the bar.
Glow
onClickEvent for when the bar is clicked.
(event: ClickEvent) => void
onMouseEnterEvent for when the bar has mouse enter.
(event: any) => void
onMouseLeaveEvent for when the bar has mouse leave.
(event: any) => void
onMouseMoveEvent for when a bar has mouse move.
(event: any) => void
classNameClassnames to apply to the element.
any
styleCSS styles to apply to the element.
any

LinearGaugeOuterBar (opens in a new tab)

PropDescriptionDefault
heightHeight of the chart. Set by `LinearGauge` component.
number
widthWidth of the chart. Set by `LinearGauge` component.
number
fillFill for the bar element.
string
#484848
x
number
y
number
bottom
number
left
number
right
number
top
number
toJSON
() => any