A line chart with the region below each line filled. Supports everything the line chart does, plus fill opacity and line/marker toggles.
Class:
dl2_reports.Area· Legacy helper:row.add_area(...)· Example: 09_area.py
from dl2_reports import Area, Threshold
page.add_row(
Area("temps", x_column="Date", y_columns=["Temperature"],
smooth=True, fill_opacity=0.4, show_markers=True,
threshold=Threshold(value=75, mode="below", apply_to="both")),
)| Parameter | Type | Description |
|---|---|---|
dataset_id |
str |
Required. Dataset id (or a formula datasource). |
x_column |
str | int |
Column for X values. |
y_columns |
str | list[str] |
Column(s) for Y series. |
smooth |
bool |
Smooth curves instead of straight segments. |
show_line |
bool |
Line stroke on top of the fill (viewer default True). |
show_markers |
bool |
Interactive marker points (viewer default True). |
fill_opacity |
float |
Fill opacity 0–1 (viewer default 0.3). |
show_legend |
bool |
Show the legend. |
show_labels |
bool |
Show value labels on points. |
min_y / max_y |
float |
Y-axis bounds (otherwise auto). |
colors |
list[str] |
Series colors. |
threshold |
Threshold | dict |
Pass/fail coloring of areas, lines, and markers — see Thresholds. |
x_axis_label / y_axis_label |
str |
Axis labels. |
enable_export |
bool |
(dl2 0.5+) Right-click Export PNG / Export SVG image export (viewer default True). |
export_file_name |
str |
(dl2 0.5+) Base file name for exported images, no extension (viewer falls back to title → dataset id → chart type). |
context_menu |
bool |
(dl2 0.5+) Right-click context menu (viewer default True). |
extra |
dict |
Passthrough props. |
**common |
Common visual properties. |
- Multiple series overlap (they are not stacked); keep
fill_opacitylow when charting more than one series. - Threshold coloring applies to the fill and the stroke, with gradient
blending at crossings (
blend_width).
- Line — the same chart without fill.
- Thresholds · Annotations.
- Chart image export — PNG/SVG export details (dl2 0.5+).