Skip to Content
DocsπŸ“Š ⏐ ChartsArea 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Β 

NameTypeDefault
dataChartDataShape[]

Data the chart will receive to render.

[]
seriesReactElement<AreaSeriesProps, FC<Partial<AreaSeriesProps>>>

The series component that renders the area/line/circles components.

`<AreaSeries />`
yAxisReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>

The linear axis component for the Y Axis of the chart.

`<LinearYAxis type="value" />`
xAxisReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>

The linear axis component for the X Axis of the chart.

`<LinearXAxis type="time" />`
gridlinesReactElement<GridlineSeriesProps, FC<Partial<GridlineSeriesProps>>> | null

The chart’s background gridlines component.

`<GridlineSeries />`
brushReactElement<ChartBrushProps, FC<Partial<ChartBrushProps>>> | null

The chart’s brush component.

zoomPanReactElement<ChartZoomPanProps, FC<Partial<ChartZoomPanProps>>> | null

The chart’s zoom pan component.

secondaryAxisReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>[]

Any secondary axis components. Useful for multi-axis charts.

idstring

Id of the chart.

widthnumber

Width of the chart. If not provided will autosize.

heightnumber

Height of the chart. If not provided will autosize.

marginsMargins

Margins for the chart.

classNamestring

Classnames for the chart.

containerClassNamestring

Classnames for the chart.

styleStyleHTMLAttributes<SVGSVGElement>

Additional css styles.

centerboolean

Center the chart. Used mainly internally.

centerXboolean

Center chart on X Axis only. Used mainly internally.

centerYboolean

Center chart on Y Axis only. Used mainly internally.

AreaSeriesΒ 

NameTypeDefault
idstring

Id set internally by AreaChart.

xScaleany

D3 scale for X Axis. Set internally by AreaChart.

yScaleany

D3 scale for Y Axis. Set internally by AreaChart.

dataChartInternalDataShape[]

Parsed data shape. Set internally by AreaChart.

heightnumber

Height of the chart. Set internally by AreaChart.

widthnumber

Width of the chart. Set internally by AreaChart.

animatedboolean

Whether to animate the enter/update/exit.

true
typeAreaChartTypes

Type of area chart to render.

'standard'
interpolationInterpolationTypes

Interpolation type for the area/line.

'linear'
tooltipReactElement<TooltipAreaProps, ForwardRefExoticComponent<Partial<TooltipAreaProps> & RefAttributes<any>>>

Tooltip for the chart area.

`<TooltipArea />`
markLineReactElement<MarkLineProps, FC<Partial<MarkLineProps>>> | null

Markline for the chart.

`<MarkLine />`
symbolsReactElement<PointSeriesProps, FC<Partial<PointSeriesProps>>> | null

Symbols used to show points.

`<PointSeries />`
lineReactElement<LineProps, FC<Partial<LineProps>>> | null

Line that is rendered.

`<Line />`
areaReactElement<AreaProps, FC<Partial<AreaProps>>> | null

Area that is rendered.

`<Area />`
colorSchemeColorSchemeType

Color scheme for the series.

'cybertron'
isZoomedboolean

Whether the chart has been zoomed or not. Set internally by AreaChart.

valueMarkersReactElement<LinearValueMarkerProps, FC<LinearValueMarkerProps>>[] | null

Value markers line for the chart.

AreaΒ 

NameTypeDefault
idstring

Id set internally by AreaSeries.

dataChartInternalDataShape[]

Parsed data shape. Set internally by AreaChart.

interpolationInterpolationTypes

Interpolation for the area. Set internally by AreaSeries.

'linear'
colorany

Color for the area. Set internally by AreaSeries.

xScaleany

D3 scale for X Axis. Set internally by AreaChart.

yScaleany

D3 scale for Y Axis. Set internally by AreaChart.

indexnumber

Index of the area in the series. Set internally by AreaSeries.

totalnumber

Total number of areas in the series. Set internally by AreaSeries.

animatedboolean

Whether to animate the enter/update/exit. Set internally by AreaSeries.

maskReactElement<MaskProps, FC<MaskProps>> | null

Mask to apply to the area.

gradientReactElement<GradientProps, FC<Partial<GradientProps>>> | null

Gradient to apply to the area.

`<Gradient />`
glowGlow

Glow to apply to the area.

pointerEventsstring

Pointer events to manage the area events.

'none'
classNameany

Classnames to apply to the element.

styleany

CSS styles to apply to the element.

LineΒ 

NameTypeDefault
idstring

Id set internally by AreaChart.

dataChartInternalDataShape[]

Parsed data shape. Set internally by AreaChart.

widthnumber

Width of the chart. Set internally by AreaChart.

interpolationInterpolationTypes

Interpolation for the area. Set internally by AreaSeries.

colorany

Color for the area. Set internally by AreaSeries.

xScaleany

D3 scale for X Axis. Set internally by AreaChart.

yScaleany

D3 scale for Y Axis. Set internally by AreaChart.

indexnumber

Index of the area in the series. Set internally by AreaSeries.

animatedboolean

Whether to animate the enter/update/exit. Set internally by AreaSeries.

strokeWidthnumber

Stroke width of the line.

3
showZeroStrokeboolean

Show the stroke if there is no value.

true
hasAreaboolean

Internal property to identify if there is a area or not.

gradientReactElement<GradientProps, FC<Partial<GradientProps>>> | null

Gradient to apply to the line.

glowGlow

Glow to apply to the line.

classNameany

Classnames to apply to the element.

styleany

CSS styles to apply to the element.

PointSeriesΒ 

NameTypeDefault
animatedboolean

Determines if the points should be animated or not.

colorany

The color of the points.

activeValuesany

The active values for the points.

dataChartInternalShallowDataShape[]

The data for the points.

yScaleany

The y-scale for the points.

xScaleany

The x-scale for the points.

idstring

The unique identifier for the points.

heightnumber

The height of the points.

widthnumber

The width of the points.

showboolean | "hover" | "first" | "last"

Determines when the points should be shown. Can be a boolean or one of the following strings: β€˜hover’, β€˜first’, β€˜last’.

'hover'
pointReactElement<ScatterPointProps, FC<Partial<ScatterPointProps>>>

The point element.

`<ScatterPoint />`
indexnumber

The index of the points.

Last updated on