Usage
Props
number | string
The x-coordinate of the center of the dot.This value is using your chart’s domain, so you will provide a data value instead of a pixel value.
ReferenceDot will internally calculate the correct pixel position.
number | string
The y-coordinate of the center of the dot.This value is using your chart’s domain, so you will provide a data value instead of a pixel value.
ReferenceDot will internally calculate the correct pixel position.
number
default:"10"
The radius of the dot in pixels.
string
default:"#fff"
The fill color of the dot.
number
default:"1"
The opacity of the fill.
string
default:"#ccc"
The stroke color of the dot.
number | string
default:"1"
The width of the stroke.
boolean | string | number | object | ReactElement | function
default:"false"
Renders a single label.
false: no labels are renderedstring|number: the content of the labelobject: the props of LabelList componentReactElement: a custom label elementfunction: a render function of custom label
ReactElement | function
If set a ReactElement, the shape of dot can be customized.
If set a function, the function will be called to render customized shape.
'discard' | 'hidden' | 'visible' | 'extendDomain'
default:"discard"
Defines how to draw the reference dot if it falls outside the chart area.
discard: don’t render if outsidehidden: render but clip to chart areavisible: render even if outsideextendDomain: extend the axis domain to include the reference dot
string | number
default:"0"
The id of x-axis which is corresponding to the data.
Required when there are multiple XAxes.
string | number
default:"0"
The id of y-axis which is corresponding to the data.
Required when there are multiple YAxes.
number
default:"600"
Z-Index of this component and its children. The higher the value,
the more on top it will be rendered.
Components with higher zIndex will appear in front of components with lower zIndex.
If undefined or 0, the content is rendered in the default layer without portals.@since 3.4
string | number
CSS class name for styling.
Event handlers
function
The customized event handler of click in this chart.
function
The customized event handler of mousedown in this chart.
function
The customized event handler of mouseup in this chart.
function
The customized event handler of mouseover in this chart.
function
The customized event handler of mouseout in this chart.
function
The customized event handler of mouseenter in this chart.
function
The customized event handler of mousemove in this chart.
function
The customized event handler of mouseleave in this chart.
Notes
This component, unlike Dot or<circle>, is aware of the cartesian coordinate system,
so you specify its center by using data coordinates instead of pixels.
ReferenceDot will calculate the pixels based on the provided data coordinates.
If you prefer to render dots using pixels rather than data coordinates,
consider using the Dot component instead.
Source
https://github.com/recharts/recharts/blob/main/src/cartesian/ReferenceDot.tsx