Skip to Content

Line Chart

A Line Chart in REAVIZ depicts data using points connected by lines, emphasizing trends and changes over a continuous set of values, typically along an x-axis and a y-axis. Line charts are effective for visualizing data trends over time or continuous data points.

Types supported by reaviz:

Where to use:

  • Show Trends Over Time: Ideal for visualizing how data changes over a period.
  • Identify Patterns: Useful for identifying patterns or trends in data sets.
  • Compare Multiple Data Sets: Great for comparing multiple sets of data.
  • Track Changes: Effective for tracking changes in data points.

Quick Start

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

Examples

Single Series

Multi Series

Radial

Stacked

Stacked Normalized

API

LineChartΒ 

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.

LineSeriesΒ 

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.

Last updated on