Skip to main content

Options

Interface

export interface ScatterChartOption {
axis: { x: AxisOption; y: AxisOption };
data: DataOption[];
background?: BackgroundOption;
grid?: GridOption;
guide?: GuideOption;
legend?: LegendOption;
padding?: Padding;
point?: PointOption;
render?: RenderOption;
}

AxisOption

PropsTypeRequiredDefaultDescription
minnumber✔️Min value for the axis
maxnumber✔️Max value for the axis
paddingnumberSets the offset of the tick labels from the axis
strokeColorstringSet the color of the axis
tickTickOption

TickOption

PropsTypeRequiredDefaultDescription
countnumber5Number of ticks to display
format(value: number) => stringDisplay format for ticks
colorstringblackstring(hex, rgb, rgba)
strokeColorstringblackstring(hex, rgb, rgba)
widthnumber5width of tick
fontstringdefault fontfont of tick
paddingtypeof PaddingOption{ top: 2, bottom: 2, left: 2, right: 2 }padding of tick

DataOption

PropsTypeRequiredDefaultDescription
typestring✔️Data type (will be used in legend)
colorstringColor to use for this data type rendering
prioritynumber99Determine the rendering priority if there is overlap. Lower number takes the higher priority
radiusnumber3Radius of data point
opacitynumber1Opacity of data point's color

LegendOption

PropsTypeRequiredDefaultDescription
formatLabel(label: string) => stringdata.typeLegend label text format
formatValue(value: number) => stringLegend data count format
hiddenbooleanfalseHide the legend if true

PointOption

PropsTypeRequiredDefaultDescription
radiusnumber3Radius of the data point
opacitynumber3Opacity of the data point

BackgroundOption

PropsTypeRequiredDefaultDescription
colorstring(hex, rgb, rgba)whiteColor of background

GridOption

PropsTypeRequiredDefaultDescription
hiddenbooleanfalseHide grid when hidden is true
strokeColorstring(hex, rgb, rgba)#d1d1d1Color of grid strokes

GuideOption

PropsTypeRequiredDefaultDescription
colorstring(hex, rgb, rgba)whiteColor of guide text
strokeColorstring(hex, rgb, rgba)blackColor of guide storke
backgroundColorstring(hex, rgb, rgba)blackColor of guide background
hiddenbooleanfalseHide guide when hidden is true. In addition, click and dragEnd events do not work.
fontCanvasTextDrawingStyles['font'] (string)default font stylefont of guide
dragDragOption

DragOption

PropsTypeRequiredDefaultDescription
strokeColorstring(hex, rgb, rgba)#469ae4Color of drag area storke
backgroundColorstring(hex, rgb, rgba)rgba(225,225,225,0.4)Color of drag area background

RenderOption

PropsTypeRequiredDefaultDescription
appendbooleanfalseAdd it to the existing data and draw by render api
drawOutOfRangebooleanfalseData that exceeds the maximum value of the y-axis is also drawn. This data is drawn on the maximum axis.

PaddingOption

PropsTypeRequiredDefaultDescription
topnumber15
bottomnumber0
leftnumber0
rightnumber0