Renders a connected line in a Cartesian chart.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/recharts/recharts/llms.txt
Use this file to discover all available pages before exploring further.
Usage
Props
The key or getter function of a group of data which should be displayed in the line.
The stroke color. If “none”, no line will be drawn.
The width of the stroke.
The pattern of dashes and gaps used to paint the line.
The interpolation type of curve. Allows custom interpolation function.See d3-shape curves for available options.
Whether to connect the line across null points.
Renders a circle element at each data point. Options:
false: no dots are drawntrue: renders the dots with default settingsobject: the props of the dot, merged with internal calculated propsReactElement: the custom dot elementfunction: a render function of the custom dot
The active dot is rendered on the closest data point when user interacts with the chart. Options:
false: dots do not change on user activitytrue: renders the active dot with default settingsobject: the props of the active dot, merged with internal calculated propsReactElement: the custom active dot elementfunction: a render function of the custom active dot
Renders one label for each data point. Options:
true: renders default labelsfalse: no labels are renderedobject: the props of LabelList componentReactElement: a custom label elementfunction: a render function of custom label
Hides the whole graphical element when true.Hiding an element is different from removing it from the chart:
Hidden graphical elements are still visible in Legend,
and can be included in axis domain calculations,
depending on
includeHidden props of your XAxis/YAxis.The name of data.
This option will be used in tooltip and legend to represent this graphical item.
If no value was set to this option, the value of dataKey will be used alternatively.
The unit of data. This option will be used in tooltip.
The id of XAxis which is corresponding to the data. Required when there are multiple XAxes.
The id of YAxis which is corresponding to the data. Required when there are multiple YAxes.
The type of icon in legend.
If set to ‘none’, no legend item will be rendered.
The type of tooltip item.
If set, data will be read from this property instead of from the chart data context.
If set a ReactElement, the shape of line can be customized.
If set a function, the function will be called to render customized shape.
Animation props
If set false, animation of line will be disabled.
If set “auto”, the animation will be disabled in SSR and will respect the user’s prefers-reduced-motion system preference for accessibility.
Specifies when the animation should begin, the unit of this option is ms.
Specifies the duration of animation, the unit of this option is ms.
The type of easing function.
Whether to animate when new values appear.
The customized event handler of animation start.
The customized event handler of animation end.
Layout props
Unique identifier of this component.
Used as an HTML attribute
id, and also to identify this element internally.If undefined, Recharts will generate a unique ID automatically.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
CSS class name for styling.
Source
https://github.com/recharts/recharts/blob/main/src/cartesian/Line.tsx