Line Chart
A versatile chart for visualizing continuous quantitative data trends over time or categories, supporting custom curves, annotations, multi-series tracking, and interactive bounds.
Reflex wraps Recharts under the hood. This means you build your own charts using Recharts components and only bring in your theme tokens and custom components like chart_tooltip when and where you need it.
Examples
Basic
A simple line chart showing a single quantitative data series over time with natural smoothing curves.
Props used: data_key, stroke, stroke_width, type_, dot, is_animation_active on line; data_key, axis_line, tick_size, tick_line, tick, interval on x_axis.
Line Chart
Showing total visitors for the last 6 months
Linear
Uses linear point-to-point interpolation paths rather than a smoothed natural curve.
Props used: type_="linear" on line.
Line Chart - Linear
Showing total visitors for the last 6 months
Label
Adds standard baseline numeric annotations directly above each individual data node.
Props used: label_list inside line component container; position, offset, fill, font_size on label_list.
Line Chart - Label
Showing total visitors for the last 6 months
Multiple
Plots multiple independent data tracks simultaneously on a single shared grid timeline.
Props used: Multiple line components; data_key, stroke configurations mapping unique values.
Line Chart - Multiple
Showing total visitors for the last 6 months
Title Label
Combines data tracking nodes with custom semantic text bindings extracted dynamically directly out of individual metadata collections.
Props used: label_list rendering a specific secondary data_key attribute from data rows.
Line Chart - Title Label
Showing total visitors for the last 6 months
Minimal
Cleans up layout clutter by hiding dots entirely to emphasize clean structural trends.
Props used: dot=False on line.
Line Chart - Minimal
Showing total visitors for the last 6 months
Interactive
Demonstrates time-series layout optimization combining multi-day boundaries with dense categorical intervals.
Props used: min_tick_gap, interval="preserveStartEnd" on x_axis.
Line Chart - Interactive
Showing total visitors for the last 3 months
Footer Legend
Integrates multiple line series data layouts with a custom styled responsive inline flex-row footer legend.
Props used: Pure python *[] list comprehensions alongside semantic tracking containers mapping series identifications.
Line Chart - Multiple
Showing total visitors for the last 6 months
Desktop
Mobile
API Reference
line_chart
The core layout container coordinate mapping viewport for drawing linear graphs.
rx.recharts.line_chart(
rx.recharts.line(
data_key="desktop",
),
data=data,
width="100%",
height=250,
)
line
Defines an individual linear path stroke segment mapped onto a dataset.
rx.recharts.line(
data_key="desktop",
stroke="var(--chart-1)",
stroke_width=2,
type_="natural",
dot=False,
is_animation_active=False,
)
label_list
Appends context descriptive floating tags immediately following line graph nodes.
rx.recharts.label_list(
data_key="desktop",
position="top",
offset=20,
fill="var(--foreground)",
font_size=12,
)
x_axis
Builds horizontal grid tracking indicators.
rx.recharts.x_axis(
data_key="month",
axis_line=False,
tick={"fill": "var(--foreground)", "fontSize": 10},
)
y_axis
Builds vertical tracking grids and value thresholds.
rx.recharts.y_axis(
type_="number",
hide=True,
)
cartesian_grid
Provides clean backdrop grid intersections.
rx.recharts.cartesian_grid(
horizontal=True,
vertical=False,
)
tooltip
Hover actions triggering beautiful popover layout summaries.
chart_tooltip()