Skip to Content

Scatter Plot

A Scatter Plot in REAVIZ is a type of mathematical diagram using Cartesian coordinates to display values for two variables in a dataset. Each data point is represented as a dot, where the horizontal axis represents one variable and the vertical axis represents another.

Types supported by reaviz:

  • Scatter - Displays individual data points in a Cartesian coordinate system.
  • Bubble - Similar to scatter, but with points sized according to a third data dimension.

Where to use:

  • Show Relationships: Ideal for visualizing relationships between two variables.
  • Identify Patterns: Useful for identifying patterns, trends, and correlations in data.
  • Highlight Outliers: Great for spotting outliers and anomalies in data.

Quick Start

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

Examples

Scatter

Bubble

API

ScatterPlotΒ 

NameTypeDefault
dataChartShallowDataShape[]

Data the chart will receive to render.

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

The series component that renders the scatter components.

`<ScatterSeries />`
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.

ScatterSeriesΒ 

NameTypeDefault
pointReactElement<ScatterPointProps, FC<Partial<ScatterPointProps>>>

Point that is rendered.

`<ScatterPoint />`
xScaleany

D3 scale for X Axis. Set internally by ScatterPlot.

yScaleany

D3 scale for Y Axis. Set internally by ScatterPlot.

dataChartInternalShallowDataShape[]

Parsed data shape. Set internally by ScatterPlot.

idstring

Id set internally by ScatterPlot.

heightnumber

Height of the chart. Set internally by ScatterPlot.

widthnumber

Width of the chart. Set internally by ScatterPlot.

isZoomedboolean

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

animatedboolean

Whether to animate the enter/update/exit.

activeIdsstring[]

Active element ids to highlight.

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

Value markers line for the chart.

ScatterPointΒ 

NameTypeDefault
activeboolean

Whether the element is active or not. Set internally by ScatterSeries.

true
sizenumber | ((data: ChartInternalShallowDataShape) => number)

Size of the circle element.

4
colorColorSchemeType

Color of the circle.

schemes.cybertron[0]
cursorstring

Cursor for the element.

'pointer'
xScaleany

D3 scale for X Axis. Set internally by ScatterPlot.

yScaleany

D3 scale for Y Axis. Set internally by ScatterPlot.

heightnumber

Height of the chart. Set internally by ScatterPlot.

animatedboolean

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

true
indexnumber

Index of the element in the series. Set internally by ScatterSeries.

tooltipReactElement<ChartTooltipProps, FC<Partial<ChartTooltipProps>>> | null

Tooltip element.

`<ChartTooltip />`
dataChartInternalShallowDataShape

Parsed data shape. Set internally by ScatterPlot.

idstring

Id set internally by ScatterPlot.

glowGlow

Glow styling for the point.

symbol(data: ChartInternalShallowDataShape) => ReactNode

Symbol element to render.

visible(data: ChartInternalShallowDataShape, index: number) => boolean

Whether the elment is visiblbe or not.

onClick(data: ChartInternalShallowDataShape) => void

Event for when a symbol is clicked.

onMouseEnter(data: ChartInternalShallowDataShape) => void

Event for when the symbol has mouse enter.

onMouseLeave(data: ChartInternalShallowDataShape) => void

Event for when the symbol has mouse leave.

classNameany

Classnames to apply to the element.

styleany

CSS styles to apply to the element.

Last updated on