ChartsScatter Plot

ScatterPlot

A scatter plot is a type of chart which displays dots to represent two numeric variables. This type of chart is used to determine the relationship between two variables.

GitHub LogoSource Code

Usage

This example shows a simple scatter plot with one data series.
Each dot represents a data point, and a tooltip appears on hover.

Set horizontalRangeSlider.show to true to add a range slider below the chart for zooming into specific data ranges.

Multiple plots with splitBy

Use the splitBy prop to create multiple plots within the same chart.
In this example, two countries each have 10 data points. splitBy is set to Country to display a separate plot for each one.

Multiple Y axes

To create a scatter plot with multiple Y axes, define the yAxis prop as an array of objects.
Each object must have a unique id and a name. Then, set the measures prop as an array, where each measure includes a yAxis field that matches one of the defined axis ids.

Custom ECharts options

You can customize the chart using ECharts options.
In this example, a markLine is added to highlight a specific value or trend in the chart.