Docs
📊 ⏐ Charts
Area Chart

Area Chart

Area Charts are excellent for showing trends over time, allowing for a clear visualization of data relationships. With REAVIZ, you can easily create and customize Area Charts just in few minutes!

Types supported by reaviz:

Where to use:

  • Track Trends Over Time: Ideal for showing how data evolves over a period, such as stock prices or temperature changes.
  • Compare Multiple Categories: Useful for visualizing data for different categories in a single view, like sales figures for different products.
  • Show Cumulative Totals: Good for displaying cumulative data, such as total revenue over months.
  • Highlight Overall Trends: Better for emphasizing the overall pattern or trend rather than precise data points.
  • Visualize Continuous Data: Effective for continuous data where the area between the x-axis and the line is significant.

Quick Start

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

Examples

Single Series

Multi Series

Stacked

Stacked Normalized

Customization

You can customize the Area Chart by using various props:

  • colorScheme: Array of colors for the chart.
  • gridlines: Toggle gridlines on or off.
  • area: Customize the appearance of the area.
  • legend and tooltips: Enhance your chart by adding legends and tooltips for better data interpretation.

API

AreaChart (opens in a new tab)

PropDescriptionDefault
dataData the chart will receive to render.
ChartDataShape[]
[]
seriesThe series component that renders the area/line/circles components.
ReactElement<AreaSeriesProps, FC<Partial<AreaSeriesProps>>>
<AreaSeries />
yAxisThe linear axis component for the Y Axis of the chart.
ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>
<LinearYAxis type="value" />
xAxisThe linear axis component for the X Axis of the chart.
ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>
<LinearXAxis type="time" />
gridlinesThe chart's background gridlines component.
ReactElement<GridlineSeriesProps, FC<Partial<GridlineSeriesProps>>>
<GridlineSeries />
brushThe chart's brush component.
ReactElement<ChartBrushProps, FC<Partial<ChartBrushProps>>>
null
zoomPanThe chart's zoom pan component.
ReactElement<ChartZoomPanProps, FC<Partial<ChartZoomPanProps>>>
null
secondaryAxisAny secondary axis components. Useful for multi-axis charts.
ReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>[]
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

AreaSeries (opens in a new tab)

PropDescriptionDefault
idId set internally by `AreaChart`.
string
xScaleD3 scale for X Axis. Set internally by `AreaChart`.
any
yScaleD3 scale for Y Axis. Set internally by `AreaChart`.
any
dataParsed data shape. Set internally by `AreaChart`.
ChartInternalDataShape[]
heightHeight of the chart. Set internally by `AreaChart`.
number
widthWidth of the chart. Set internally by `AreaChart`.
number
animatedWhether to animate the enter/update/exit.
boolean
true
typeType of area chart to render.
AreaChartTypes
standard
interpolationInterpolation type for the area/line.
InterpolationTypes
linear
tooltipTooltip for the chart area.
ReactElement<TooltipAreaProps, ForwardRefExoticComponent<Partial<TooltipAreaProps> & RefAttributes<any>>>
<TooltipArea />
markLineMarkline for the chart.
ReactElement<MarkLineProps, FC<Partial<MarkLineProps>>>
<MarkLine />
symbolsSymbols used to show points.
ReactElement<PointSeriesProps, FC<Partial<PointSeriesProps>>>
<PointSeries />
lineLine that is rendered.
ReactElement<LineProps, FC<Partial<LineProps>>>
<Line />
areaArea that is rendered.
ReactElement<AreaProps, FC<Partial<AreaProps>>>
<Area />
colorSchemeColor scheme for the series.
ColorSchemeType
cybertron
isZoomedWhether the chart has been zoomed or not. Set internally by `AreaChart`.
boolean
valueMarkersValue markers line for the chart.
ReactElement<LinearValueMarkerProps, FC<LinearValueMarkerProps>>[]

Area (opens in a new tab)

PropDescriptionDefault
idId set internally by `AreaSeries`.
string
dataParsed data shape. Set internally by `AreaChart`.
ChartInternalDataShape[]
interpolationInterpolation for the area. Set internally by `AreaSeries`.
InterpolationTypes
linear
colorColor for the area. Set internally by `AreaSeries`.
any
xScaleD3 scale for X Axis. Set internally by `AreaChart`.
any
yScaleD3 scale for Y Axis. Set internally by `AreaChart`.
any
indexIndex of the area in the series. Set internally by `AreaSeries`.
number
totalTotal number of areas in the series. Set internally by `AreaSeries`.
number
animatedWhether to animate the enter/update/exit. Set internally by `AreaSeries`.
boolean
maskMask to apply to the area.
ReactElement<MaskProps, FC<MaskProps>>
gradientGradient to apply to the area.
ReactElement<GradientProps, FC<Partial<GradientProps>>>
<Gradient />
glowGlow to apply to the area.
Glow
classNameClassnames to apply to the element.
any
styleCSS styles to apply to the element.
any

Line (opens in a new tab)

PropDescriptionDefault
idId set internally by `AreaChart`.
string
dataParsed data shape. Set internally by `AreaChart`.
ChartInternalDataShape[]
widthWidth of the chart. Set internally by `AreaChart`.
number
interpolationInterpolation for the area. Set internally by `AreaSeries`.
InterpolationTypes
colorColor for the area. Set internally by `AreaSeries`.
any
xScaleD3 scale for X Axis. Set internally by `AreaChart`.
any
yScaleD3 scale for Y Axis. Set internally by `AreaChart`.
any
indexIndex of the area in the series. Set internally by `AreaSeries`.
number
animatedWhether to animate the enter/update/exit. Set internally by `AreaSeries`.
boolean
strokeWidthStroke width of the line.
number
3
showZeroStrokeShow the stroke if there is no value.
boolean
true
hasAreaInternal property to identify if there is a area or not.
boolean
gradientGradient to apply to the line.
ReactElement<GradientProps, FC<Partial<GradientProps>>>
glowGlow to apply to the line.
Glow
classNameClassnames to apply to the element.
any
styleCSS styles to apply to the element.
any

PointSeries (opens in a new tab)

PropDescriptionDefault
animatedDetermines if the points should be animated or not.
boolean
colorThe color of the points.
any
activeValuesThe active values for the points.
any
dataThe data for the points.
ChartInternalShallowDataShape[]
yScaleThe y-scale for the points.
any
xScaleThe x-scale for the points.
any
idThe unique identifier for the points.
string
heightThe height of the points.
number
widthThe width of the points.
number
showDetermines when the points should be shown. Can be a boolean or one of the following strings: 'hover', 'first', 'last'.
boolean | "hover" | "first" | "last"
hover
pointThe point element.
ReactElement<ScatterPointProps, FC<Partial<ScatterPointProps>>>
<ScatterPoint />
indexThe index of the points.
number