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Β
LinearGaugeSeriesΒ
LinearGaugeBarΒ
| Name | Type | Default |
|---|---|---|
active | booleanWhether the bar is active or not. | |
activeBrightness | numberChroma brightness factor to brighten the active bar. See https://gka.github.io/chroma.js/#color-brightenΒ for more info. | 0.5 |
xScale | anyD3 scale for X Axis. Set internally by | |
yScale | anyD3 scale for Y Axis. Set internally by | |
xScale1 | anyD3 scale for X Multi-Group Axis. Set internally by | |
data | ChartInternalShallowDataShapeParsed data shape. Set internally by | |
id | stringId set internally by | |
gradient | ReactElement<GradientProps, FC<Partial<GradientProps>>> | nullGradient shades for the bar. | `<Gradient />` |
rx | numberSVG rx attribute for the bar. | 0 |
ry | numberSVG ry attribute for the bar. | 0 |
width | numberWidth of the bar. Set internally by | |
padding | numberPadding for the bar groups. | |
barCount | numberTotal number of bars used for animation. Set internally by | |
color | anyColor callback for the bar. | |
cursor | stringCursor for the bar element. | 'auto' |
barIndex | numberIndex of the bar. Set internally by | |
groupIndex | numberIndex of the group. Set internally by | |
animated | booleanWhether to animate the enter/update/exit. Set internally by | |
isCategorical | booleanWhether this is categorical chart or not. Set internally by | |
rangeLines | ReactElement<RangeLinesProps, FC<Partial<RangeLinesProps>>> | nullRangelines element. for the bar. | |
mask | ReactElement<MaskProps, FC<MaskProps>> | nullMask element for the bar. | |
tooltip | ReactElement<ChartTooltipProps, FC<Partial<ChartTooltipProps>>> | nullTooltip element. | |
layout | DirectionDirection of the chart. Set internally by | 'vertical' |
type | BarTypeType of bar chart. Set internally by | |
label | ReactElement<BarLabelProps, FC<Partial<BarLabelProps>>> | nullLabel element. | |
targetMarker | ReactElement<BarTargetMarkerProps, FC<Partial<BarTargetMarkerProps>>> | nullTarget marker element. | `<BarTargetMarker />` |
guide | ReactElement<GuideBarProps, FC<Partial<GuideBarProps>>> | nullGuide bar component. | |
minHeight | numberForce a min height on the bar. | |
glow | GlowGlow styling for the bar. | |
onClick | (event: ClickEvent) => voidEvent for when the bar is clicked. | |
onMouseEnter | (event: any) => voidEvent for when the bar has mouse enter. | |
onMouseLeave | (event: any) => voidEvent for when the bar has mouse leave. | |
onMouseMove | (event: any) => voidEvent for when a bar has mouse move. | |
className | anyClassnames to apply to the element. | |
style | anyCSS styles to apply to the element. |