Skip to content

ScatterChart

ScatterChart Title
Prop ControlsSHOW

Props

nametypedefaultrequireddescription
absoluteScalebooleanfalseWhen true, will force including 0 in both domains
dataSetsDataSet[][]The datasets to plot, they will be drawn in order one on top of the other "lowest" (first) to "highest" (last)
drawBarsbooleanfalseDraw bar-chart bars from bottom to data points
drawCurvebooleanfalseDraw a catmull-rom curve throught the provided points
drawLegendbooleanfalseDraws a legend with togglable data
drawPointsbooleanfalseDraw unconnected data points
drawToolTipsbooleanfalseShow tooltip info when the mouse is near a point
drawXAxisbooleanfalseDraws a simple linear X Axis
drawYAxisbooleanfalseDraws a simple linear Y Axis
enablePanbooleanfalseDraw a catmull-rom curve throught the provided points
enableZoombooleanfalseDraw a catmull-rom curve throught the provided points
mouseTrackingIgnoreXbooleanfalseWhen true, mouse over queries will ignore X axis values
mouseTrackingIgnoreYbooleanfalseWhen true, mouse over queries will ignore Y axis values
subTicksXnumber0How many unlabelled ticks to draw between each pair of labelled ticks on the X Axis
subTicksYnumber0How many unlabelled ticks to draw between each pair of labelled ticks on the X Axis
tickFrequencyXstring"0"Sets density of ticks using 1-tick per distance where this prop controls the distance.

NOTE: you can set any valid css length here as a string such as 10px, 0.5em, or 30vh.| |tickFrequencyY|string|"0"|☐|Sets density of ticks using 1-tick per distance where this prop controls the distance.

NOTE: you can set any valid css length here as a string such as 10px, 0.5em, or 30vh.| |title|string|null|☐|The title of this graph, leave undefined to omit|

Slots

background

Contains the plot background and both axes.

proptypecomment
domStateDOMStatethe wrapping DDV component's DOMState
marginsMarginsthe wrapping DDV component's margins
xScalerLinearScalerreturns the x pixel for a given data point's x value
yScalerLinearScalerreturns the y pixel for a given data point's y value
toolTipInfoToolTipInfoThe same info sent to tooltips, contains nearest point in both screen/data space as well as distance from the cursor and original index of the point in the dataset's points

perSeries

This slot will be called once for each props.dataSets. This is a good slot to draw points or lines, as it will have everything you need to properly place interpolated items for each DataSet.

proptypecomment
domStateDOMStatethe wrapping DDV component's DOMState
marginsMarginsthe wrapping DDV component's Margins
mouseStateMouseStatethe wrapping DDV component's MouseState
screenPointsPoint[]all points (after decimation) in screen space
nearestPointNearestPoint | nullall points (after decimation) in screen space
xScalerLinearScalerreturns the x pixel for a given data point's x value
yScalerLinearScalerreturns the y pixel for a given data point's y value
inactiveDataSetsArray<number>an array of dataSet indexes that have been disabled by the user
dataSeriesNumbernumberthis sets the CSS var of the active plot
aggregateXDomainDomainthe min/max for all x's all datasets
aggregateYDomainDomainthe min/max for all y's all datasets

legend

This slot expects to draw the legend for the chart when props.drawLegend is true. By default it will draw a ChartLegend

proptypecomment
toolTipInfoToolTipInfoThe same info sent to tooltips, contains nearest point in both screen/data space as well as distance from the cursor and original index of the point in the dataset's points
domStateDOMStatethe wrapping DDV component's DOMState
marginsMarginsthe wrapping DDV component's Margins
mouseStateMouseStatethe wrapping DDV component's MouseState
activateSeries(dataSeriesNumber:number) => voida function that activates a series by dataSets index
deactivateSeries(dataSeriesNumber:number) => voida function that deactivates a series by dataSets index
inactiveDataSetsArray<number>an array of dataSet indexes that have been disabled by the user
dataSetsDataSet[]The processed data sets from the SeriesReducer

title

When props.title is set, will draw a ChartTitle by default.

proptypecomment
titlestringthe chart's title
domStateDOMStatethe wrapping DDV component's DOMState
marginsMarginsthe wrapping DDV component's Margins

crosshairs

Draws lines and other indicators based on live updating mouse movements

proptypecomment
domStateDOMStatethe wrapping DDV component's DOMState
marginsMarginsthe wrapping DDV component's Margins

tooltip

Draws lines and other indicators based on live updating mouse movements

proptypecomment
chartIdstringInternal ID generated by the DDV component
toolTipInfoToolTipInfoThe same info sent to tooltips, contains nearest point in both screen/data space as well as distance from the cursor and original index of the point in the dataset's points

Emitted Events

None

Released under the MIT License.